Commit Graph

635 Commits

Author SHA1 Message Date
Søren Schmidt
5c0d1ab990 Sync with the spl changes in -stable.
Add start of support for DVD+RW.
2002-07-22 18:36:14 +00:00
Søren Schmidt
2dadf47412 Update the tags handling a bit, which makes support for the
older IBM DTTA series of drives possible.
Update error handling a bit now we are here.
2002-07-22 18:35:01 +00:00
Peter Wemm
b5d0be8951 Remove dependency on NPCI. Use 'options ATA_NOPCI' to compile without
pci support.  This really needs to be fixed properly some day, but judging
by the fact that the nopci case hasn't compiled for quite a while, there
does not seem to be much urgency.

Reviewed by:	sos
2002-07-21 21:37:09 +00:00
John Baldwin
c584bd8f63 Add PCI ID for the ICH4 ATA100 controller.
Sponsored by:	The Weather Channel
2002-07-19 22:14:54 +00:00
Søren Schmidt
9153cecd64 Use si_iosize_max to tell the upper layers not to use more
than 32K chunks on ZIP drives instead of deblocking it in
the driver.
2002-06-19 12:41:05 +00:00
Søren Schmidt
098d258d05 Add yet another (older) Promise chip 2002-06-19 12:26:20 +00:00
Søren Schmidt
0b2577457c Fix a '<<' that should have been a '>>' in the 48bit case.
Fortunately we only have had 32bit block counts until recently,
and no 2TB disks :)
2002-06-08 21:33:42 +00:00
Søren Schmidt
d9d34030a4 Use %02d in track numbers, so that 1 is 01, much easier for scripts 2002-05-28 17:39:17 +00:00
Bruce Evans
e788f79698 Fixed printf format errors which apparently crept in while -Wformat was
disabled for gcc-3.
2002-05-25 11:18:03 +00:00
Søren Schmidt
949e9d36aa Dont panic if only one disk on a channel can do tagged queueing.
MFC:	asap
2002-05-23 08:17:16 +00:00
Mike Barcroft
a30d4b3270 Move the new byte order function prototypes from <sys/param.h> to
<sys/endian.h>.  This puts us in line with NetBSD and OpenBSD.
2002-04-26 22:48:23 +00:00
Søren Schmidt
091a610ac9 Fix the breakage of tagged queueing that the busdma integration
introduced. Since its now only possible to have one DMA control
block at a time, we move the setup to dmastart instead.
2002-04-18 19:11:45 +00:00
Søren Schmidt
4ec627a3eb Add support for the nVIDIA nForce ATA controller.
Collapse the VIA/AMD/nVIDIA support code into one, they are
created more or less equal anyway..
2002-04-16 08:30:51 +00:00
Søren Schmidt
6ed14aa161 Add a couble more Promise chip ID's. 2002-04-12 14:10:19 +00:00
Søren Schmidt
5b93eb04a9 Add yet another chip ID for a Promise TX2 chip. 2002-04-11 11:04:23 +00:00
Søren Schmidt
f8b318ce58 Only calculate Promise magic if a device is there for info. 2002-04-11 08:52:32 +00:00
Søren Schmidt
56397b300c Fix the FreeBSD native ATA RAID code a bit. 2002-04-10 11:18:07 +00:00
Søren Schmidt
a12b615d49 Add yet another ATA133 Promise chip. 2002-04-07 07:53:34 +00:00
Søren Schmidt
32dbed0488 Unlock the channel again if an ata_reinit() fails. 2002-04-05 18:37:04 +00:00
Søren Schmidt
268f0ea9a3 Change option ATA_ENABLE_BUSMASTER into ifdef __sparc64__ 2002-04-05 18:05:17 +00:00
Søren Schmidt
ede0f136df Cleanups. 2002-04-05 18:04:05 +00:00
Søren Schmidt
111ab6f7ed Dont allow to detach twice. 2002-04-05 18:02:33 +00:00
Søren Schmidt
22c60e8d8c Add forgotten ATA_UNLOCK_CH when getting status from non-existing
enclosure.
2002-04-05 15:58:45 +00:00
Søren Schmidt
7800211b08 Make the ATA driver compile & work on the sparc64 platform.
Initial work & code by tmm.

Lots of changes and rearrangements by yours truely to make busdma
be a little less a PITA (but I still dont like it).
2002-04-05 13:13:56 +00:00
Søren Schmidt
3eb933c093 Correct the Northbridge test on the new ATA133 VIA's
Misc cosmetics now I'm there.
2002-04-02 16:45:06 +00:00
Søren Schmidt
3348c0092c Add get-status to the ATA RAID subsystem. 2002-04-02 13:48:17 +00:00
Poul-Henning Kamp
408ab1b875 Retire the bogus ioctl DIOCGPART in toto.
Once again we can notice that badly thought out hacks ferment and infect
far more code than initially expected.

Sponsored by:	DARPA and NAI Labs.
2002-04-02 11:52:13 +00:00
John Baldwin
44731cab3b Change the suser() API to take advantage of td_ucred as well as do a
general cleanup of the API.  The entire API now consists of two functions
similar to the pre-KSE API.  The suser() function takes a thread pointer
as its only argument.  The td_ucred member of this thread must be valid
so the only valid thread pointers are curthread and a few kernel threads
such as thread0.  The suser_cred() function takes a pointer to a struct
ucred as its first argument and an integer flag as its second argument.
The flag is currently only used for the PRISON_ROOT flag.

Discussed on:	smp@
2002-04-01 21:31:13 +00:00
Poul-Henning Kamp
81661c94b6 Here follows the new kernel dumping infrastructure.
Caveats:

The new savecore program is not complete in the sense that it emulates
enough of the old savecores features to do the job, but implements none
of the options yet.

I would appreciate if a userland hacker could help me out getting savecore
to do what we want it to do from a users point of view, compression,
email-notification, space reservation etc etc.  (send me email if
you are interested).

Currently, savecore will scan all devices marked as "swap" or "dump" in
/etc/fstab _or_ any devices specified on the command-line.

All architectures but i386 lack an implementation of dumpsys(), but
looking at the i386 version it should be trivial for anybody familiar
with the platform(s) to provide this function.

Documentation is quite sparse at this time, more to come.

Details:

ATA and SCSI drivers should work as the dump formatting code has been
removed.  The IDA, TWE and AAC have not yet been converted.

Dumpon now opens the device and uses ioctl(DIOCGKERNELDUMP) to set
the device as dumpdev.  To implement the "off" argument, /dev/null
is used as the device.

Savecore will fail if handed any options since they are not (yet)
implemented.  All devices marked "dump" or "swap" in /etc/fstab
will be scanned and dumps found will be saved to diskfiles
named from the MD5 hash of the header record.  The header record
is dumped in readable format in the .info file.  The kernel
is not saved.  Only complete dumps will be saved.

All maintainer rights for this code are disclaimed: feel free to
improve and extend.

Sponsored by:   DARPA, NAI Labs
2002-03-31 22:37:00 +00:00
Søren Schmidt
db9df6ae8f ATA100 is allowed on the HPT chips rev >= 3 2002-03-31 13:33:55 +00:00
Søren Schmidt
60378464bb Remove debug output in last commit. 2002-03-30 16:51:47 +00:00
Søren Schmidt
4486f609fc Add support for getting status (fan, temp, 5V and 12V levels) from
Promise Superswap enclosures.

Sponsored by: Advanis
2002-03-30 16:36:41 +00:00
Søren Schmidt
7e2437190c Use the raid lun not the magic when writing Promise config. 2002-03-30 11:15:46 +00:00
Søren Schmidt
5847590d42 Fix a braino, only update LED's when a device is present. 2002-03-28 11:48:36 +00:00
Søren Schmidt
5f3950daa4 OK, the old HighPoint BIOS's are braindead, they have
a really warped way of things. Anyway deal with it,
and luckily the newer HighPoint BIOS's doesn't mind..

No brownies to HighPoint for that...
2002-03-27 22:05:38 +00:00
Søren Schmidt
fe4f5b97e0 Fix support for multi CD changers, it was as broken as my old NEC :)
MFC: ASAP

:
2002-03-27 19:47:52 +00:00
Søren Schmidt
85db7089ec Add support for creating/deleting ATA RAID's.
This completes the ATA RAID support, since all functions to manipulate
the RAID are accessible from FreeBSD, the BIOS on the ATA RAID cards
are only nessesary for booting.

I decided to allow for creation of ATA RAID's on any ATA controller, but
please keep in mind the restrictions on that. Due to the BIOS not
knowing what to do you can only boot from a RAID1 or the first disk
in a SPAN, if its not located on a "real" ATA RAID controller like
the Promise or Highpoint controllers.

Sponsored by: Advanis
2002-03-27 10:58:59 +00:00
Søren Schmidt
d42c4a3ba6 Misc little cleanups. 2002-03-26 09:31:22 +00:00
Søren Schmidt
38009ef247 Add AMD 768 support. 2002-03-24 12:44:23 +00:00
Peter Wemm
bcb6ef7c82 Add some break's after default: in the end of switch statements to
keep gcc-3.1+ happy:
ata-all.c:410: warning: deprecated use of label at end of compound statement
ata-all.c:587: warning: deprecated use of label at end of compound statement
ata-raid.c:99: warning: deprecated use of label at end of compound statement
ata-raid.c:151: warning: deprecated use of label at end of compound statement
2002-03-19 12:14:14 +00:00
Søren Schmidt
a86fb2a588 Cleanup the chipset setup a bit.
Add some (for all I know unneeded) setup code for the rosb4.
2002-03-18 13:56:44 +00:00
Søren Schmidt
2c66127540 Add support for the ServerWorks CSB5 chips 2002-03-18 12:13:13 +00:00
Søren Schmidt
4e887e1915 Add more functionality to the CDIOCREADSUBCHANNEL ioctl.
PR: 26644
2002-03-16 15:56:54 +00:00
Søren Schmidt
698d5a2c84 Fix 64bit arch problems. 2002-03-16 15:55:20 +00:00
Søren Schmidt
e1a86e393c Remove useless splXXX set. 2002-03-16 15:54:41 +00:00
Søren Schmidt
7bdca10c47 Update to the RAID1 rebuild code.
Run rebuild as a background process.

Sponsored by: Advanis
2002-03-15 15:39:54 +00:00
Søren Schmidt
733c2fbdd3 Unbreak the probing of some CDROM drives. 2002-03-14 21:35:55 +00:00
Søren Schmidt
fe86c44885 Add new support for locking an ATA channel and use that throughout
the ATA/ATAPI driver. This solves the concurrency problem with
the new GEOM code, and also cuts a good deal of the patch size
in the upcoming MFC.
2002-03-11 21:04:32 +00:00
Søren Schmidt
835d29c0cd Silence a warning when compile without atapi devices. 2002-03-10 21:03:04 +00:00
Søren Schmidt
fefe430118 Even more Highpoint RAID support.
Fix the 80pin cable detection system.
2002-03-08 21:36:49 +00:00
Søren Schmidt
84409b36ca Support newer Highpoint BIOS's extended config. 2002-03-08 11:33:52 +00:00
Søren Schmidt
b8ad1eb270 cosmetics 2002-03-08 11:31:37 +00:00
Søren Schmidt
c1d33c30e9 Oops I mixed up the patch for -current & -stable, sorry .... 2002-03-07 19:20:23 +00:00
Søren Schmidt
216cc529d5 Minor cosmetic changes to minimise diffs for MFC. 2002-03-07 16:34:19 +00:00
Søren Schmidt
5ba86f4c8a Fix a couble of bugs in the rebuild code, return errors properly. 2002-03-07 16:32:21 +00:00
Bruce Evans
d4621eac57 Fixed a printf format error again. Rev.127 was clobbered in rev.1.128
by removing parentheses.  The main bug is in gcc: on machines with
64-bit longs and 64-bit long longs,

    (unsigned long long)rdp->total_sectors / ((1024L * 1024L) / DEV_BSIZE))

has type plain unsigned long instead of the correctly promoted type
unsigned long long, so it can not be printfed using %llu format.  Even
1ULL / 1L is mispromoted.  Anyway, casting the correct operand
automatically avoids the problem.  We do not want to to pessimize the
division; we just want to convert to a common maximal type for printing.
2002-03-06 06:33:33 +00:00
Søren Schmidt
11de413756 Misc little cleanups:
Link if only ATAPI device in kernel config
Remove unused #includes
Rearrange a bit in ata-raid to make diff against -stable smaller
Enable wc as default again, dunne how this happend...
2002-03-05 09:24:19 +00:00
Søren Schmidt
0f0e725b18 Forgot this litte patch, scale the individual disk size from the
arrays total size depending on width of the array.
2002-03-03 16:36:19 +00:00
Søren Schmidt
6f87be981b Major update of the ATA RAID code, part 3:
Add code to properly detach/attach disks that are part of a RAID.

Mark a disk that is attached on an ATA channel belonging to a
RAID as a spare disk that can be used for rebuilding failed RAID1's.

Add support for rebuilding failed RAID1's.

Several fixes to the detach/attach code.

For replacing a disk in a failed RAID1 do the following:

Find the controller channel# of the failed disk.

Exec 'atacontrol detach <channel#>' to free the disk from the system.

Replace the failed disk with a new one of at least the same size.
If your have your disks in drawers/enclosures this can be done with
the system still running.

Exec 'atacontrol attach <channel#>' to add the disk to the system and
mark it as a valid spare for rebuild.

Exec 'atacontrol rebuild <array#>'

The system will rebuild the array on the fly, the array can still
be used during this, although with slower performance.

Please let me know of any problems with this!

Sponsored by: Advanis Inc.

MFC after: 2 weeks
2002-03-03 15:36:21 +00:00
Bruce Evans
b980740327 Fixed a printf format error. 2002-03-02 10:54:33 +00:00
Søren Schmidt
acf7db1110 Finish phk's previous removal of BIO_ORDERED, all code that
depended on ATA_FLUSHCACHE_ON is now useless.
2002-02-24 12:28:24 +00:00
Poul-Henning Kamp
af91f4fa16 GC: BIO_ORDERED going away. 2002-02-22 09:18:46 +00:00
Søren Schmidt
e6f71b525d Add support for the Highpoint HPT372 based cards (rocketraid 133).
HW Sponsored by: Mike Tancsa
2002-02-18 11:57:56 +00:00
Søren Schmidt
dc9395ae1f Fix the problem that some (in my book broken) disks reports
to be able to use 48bit addressing mode, but says the 48bit
size of the disk is 0, which according to spec means it can
address zero sectors in 48bit mode, why then say it supports
48bit mode at all..
2002-02-18 11:52:51 +00:00
Søren Schmidt
72afad5ba4 Dont try to attach ATA RAID's if none found. 2002-02-16 08:10:24 +00:00
Bruce Evans
1e9ea774c0 Added undocumented options AAC_DEBUG, ACD_DEBUG, ACPI_MAX_THREADS,
ACPI_NO_SEMAPHORES, ASR_MEASURE_PERFORMANCE, AST_DEBUG, ATAPI_DEBUG,
ATA_DEBUG, BKTR_ALLOC_PAGES, BROOKTREE_ALLOC_PAGES, CAPABILITIES,
COMPAT_SUNOS, CV_DEBUG, MAXFILES, METEOR_TEST_VIDEO, NDEVFSINO,
NDEVFSOVERFLOW, NETGRAPH_BRIDGE, NETSMB, NETSMBCRYPTO, PFIL_HOOKS,
SIMOS, SMBFS, VESA_DEBUG, VGA_DEBUG.

Start using #! to comment out negative options and ## to comment out
broken options.

atapi-all.c:
Fixed rotted bits that were hiding under ATAPI_DEBUG.

atapi-cd.c:
#include "opt_ata.h" so that ACD_DEBUG is actually visible.

ata/atapi-tape.c
#include "opt_ata.h" so that AST_DEBUG is actually visible.
2002-02-15 07:08:44 +00:00
Søren Schmidt
d99689e95c Add support for the Cenatek Rocket Drive. 2002-02-12 16:59:28 +00:00
Søren Schmidt
2c028bf06a Fix buglets in the ATAPI resume code.
This also fixes an old bug where some ATAPI devices went into
funny mode on an 'atacontrol reinit' command.
2002-02-12 13:21:51 +00:00
Søren Schmidt
e1605c6270 Major update of the ATA RAID code, part 2:
More cleanups of the RAID1 failure mode code.

Add functionality that writes the changed RAID config setup
back to the disks (in controller BIOS specific format), so
that a reboot will make the BIOS pick up the changed config.
2002-02-12 11:35:15 +00:00
Søren Schmidt
15641a2f41 Add support for the HighPoint HPT374 4 channel ATA chip.
Sponsored by: Isilon Systems.
2002-02-11 15:48:04 +00:00
Julian Elischer
4ad88f2ca4 Make LINT compile after fruitless attempts to get the authors
to fix their code.

ata stuff:
Change name of ar_attach to not colide with existing ar_attach in if_ar.c.
usb stuff:
Create a dummy function to satisfy a call to it when in DEBUG mode.
2002-02-06 19:35:37 +00:00
Søren Schmidt
6ddce9039b Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.

A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.

Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.

Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.

Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.

If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.

Misc fixes that I had lying around for various minor bugs.

Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
Søren Schmidt
684c972cd6 Add support for the Promise TX4.
Rearrange the support for the VIA chips, and add experimental
support for ATA133 on the newest chips.
2002-01-28 13:17:10 +00:00
Søren Schmidt
d2e812582d Add support for pccard.
submitted by: imp
2002-01-28 13:12:16 +00:00
Søren Schmidt
a643d91a46 Update of the VIA 82c686b southbridge data corruption fix, also
include more possible chipset candidates.
2002-01-01 19:58:11 +00:00
Søren Schmidt
3afc6bfba4 Add support for even more SiS chipsets.
Misc cosmetics.
2001-12-25 14:44:26 +00:00
Søren Schmidt
069da12b0e Fix yet another fake slave problem for PCCARD devices. 2001-12-25 14:43:08 +00:00
John Baldwin
4db62c69c2 Display the right message for the SiS 645 chipset.
Submitted by:	Kent Stewart <kstewart@owt.com>
2001-12-19 01:53:11 +00:00
John Baldwin
c8e555ec14 Fix comment for the SiS 645 chipset to be 645 instead of 635. 2001-12-19 01:23:32 +00:00
Søren Schmidt
ae22ec847b Adjust the timings for the SiS chips a bit, also add the SiS 645.
Cosmetics on the Acer chips (print right modes)
2001-12-14 21:28:49 +00:00
Søren Schmidt
de56c1c5d8 Do be so anal on detach, properly free interrupt even if no devices. 2001-12-14 21:23:19 +00:00
Søren Schmidt
bc48b9d025 Allow setting the CD type on cue sheets 2001-12-04 21:39:34 +00:00
Søren Schmidt
f609857c68 ARG! committed the wrong patch!! I need more sleep :( 2001-12-02 12:19:16 +00:00
Søren Schmidt
71a6a4da18 Oops, lost a line in the previous commit. 2001-12-02 12:17:51 +00:00
Søren Schmidt
7c5a0723d7 Initial support for the newer SiS chipsets, based on docs we finally
got from SiS.

This should also close PR 32421 which has patches which seem
to set the timing registers wrongly according to SiS...
2001-12-02 10:48:52 +00:00
Søren Schmidt
e29e633207 Add yet another VIA ATA100 southbridge. 2001-11-13 11:37:23 +00:00
Søren Schmidt
7afba84a9f Fix bogon, free() the right memory type. 2001-11-13 11:33:23 +00:00
Paul Saab
817805d9c9 Fix a signed bug in the crashdump code for systems with > 2GB of ram.
Reviewed by:	peter
2001-11-13 01:08:54 +00:00
Poul-Henning Kamp
0ac42ec512 Don't call cdevsw_add(). 2001-11-04 09:09:41 +00:00
Andrey A. Chernov
f21d113aa0 Use devclass_find_free_unit() in ata_pci_add_child() because no more
implicit auto-scanning up present in device_add_child(). Functionally it is
fully equivalent to old code.
2001-11-01 05:21:49 +00:00
Dag-Erling Smørgrav
27c97f7660 Don't enable write cacheing on devices that don't support tagged queuing
unless hw.ata.wc is set.

Approved by:	sos
MFC after:	1 week
2001-10-24 18:24:09 +00:00
Søren Schmidt
d5c047cf10 Add a bunch of new PCI ID's for Intel ATA chips. 2001-10-23 09:57:49 +00:00
Søren Schmidt
e32abc1a60 Add experimental support for the HighPoint HPT372 ATA133 controller.
Based on docs kindly provided by HighPoint which we thank for
the close cooperation with the FreeBSD project!.
2001-10-23 09:25:57 +00:00
Søren Schmidt
6a1f123c0c Add experimental support for the Promise ATA133 controller.
This might need additional code for hotswapping use, but first
I need to get my hands on actual hw...

Based on docs kindly provided by Promise Inc which we thank for
the close cooperation with the FreeBSD project!.
2001-10-23 08:01:47 +00:00
Søren Schmidt
7ebc82d6ec Make an ATAPI CD device appear as /dev/acdN and the individual
tracks as /dev/acdNtY.

This solves the problems with having to deal with howmany and which
devices are open.

For hysterical reasons ONLY, make a link to both the acdNa & acdNc devices.
2001-10-19 13:34:48 +00:00
Søren Schmidt
db92bfc1b4 Fix bug introduced by the last commit, the caused some ATAPI
devices to fail to proberly initialize at boot..
2001-10-16 08:07:36 +00:00
Matt Jacob
ca8f579ceb Fix it so that it doesn't complain for compiles on alpha- that is, match
format string args to actual args.
2001-10-14 19:44:15 +00:00
Søren Schmidt
8975eded26 Update with latest ATA/ATAPI ver 6 rev 2 items. 2001-10-06 11:07:04 +00:00
Søren Schmidt
c36c574aaa Update the promise raid structure with some of the info I've gathered
before I'm accused of "lending" it from somebody else.
2001-10-04 18:02:26 +00:00
Søren Schmidt
e55639dbdd Doh! committed from the wrong tree, this is the right "stuff"... 2001-10-03 11:36:25 +00:00
Søren Schmidt
7f6d63666d Proberly support the Promise TX2/4.
Programming info kindly provided by Daniela Engert <dani@ngrt.de>
2001-10-03 08:27:29 +00:00
Søren Schmidt
592fcea788 cosmetics in the bootverbose probe- 2001-10-03 08:25:37 +00:00
Søren Schmidt
9b7c4d4ea0 Hopefully fix the identify failed on ATAPI slaves on some notebooks. 2001-10-03 08:25:11 +00:00
Søren Schmidt
7a845ac23c Change the way DAO/TAO mode is init'ed.
Fix a bogon introduced in the previous commit, that broke CDIOREADSUBCHANNEL.
2001-10-01 14:59:52 +00:00
Søren Schmidt
72c2f499ce Add a fix for the VIA82C686B data corruption bug.
This fixed the problem on the 3 platforms I've been able to test on.

I'm still of the oppinion that the BIOS should take care of this,
however some board makers only apply this when they spot a
SBLive! soundcard, but the problem exists even without a SBLive!.

This fix should probably go somewhere else, but for now I'll
keep it here since we havn't got a central place to put
such things.
2001-09-25 17:10:39 +00:00
Søren Schmidt
f601b4eb7c Overhaul to minimize stack usage, in some places >2K was used
on the stack *blush*...
2001-09-20 15:25:36 +00:00
Julian Elischer
b40ce4165d KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after:    ha ha ha ha
2001-09-12 08:38:13 +00:00
Søren Schmidt
45ae719fd9 Add kernel side support for DAO burning. 2001-09-10 11:43:20 +00:00
Søren Schmidt
67bc4ad9b6 Fix the size of medium code, the old one failed for DVD's.
This might introduce problems on normal CD's (again) sigh...
2001-09-06 17:44:04 +00:00
Søren Schmidt
3da21d9f07 Fix verbose probe message.
PR: 29360
2001-09-06 09:50:25 +00:00
Søren Schmidt
1be5b45b7c Add support for set/getting the region code on DVD drives.
PR: 28604
2001-09-06 08:52:28 +00:00
Søren Schmidt
1f3d9edf37 Make "atapi less" kernels link again.
Question is if we should allow the ioctl only interface to be
created if atapi devices are present, but no driver linked in....
2001-09-01 08:47:11 +00:00
Søren Schmidt
baffdee40e Add support for sending ATAPI commands via ioctl. 2001-08-30 09:47:17 +00:00
Søren Schmidt
a8ae536239 Update the Promise TX2 code to DTRT and not what I guessed earlier.
Allow tagged queing on the Promise TX2 as it seems to work.

Cudos to promise for making the most simple to program ATA chip.
2001-08-28 13:36:06 +00:00
Søren Schmidt
b4fa8260b8 Add support for yet another VIA '686 combination. 2001-08-28 08:59:17 +00:00
Søren Schmidt
65d5e55cdd Add support for the newer Promise chips here as well. 2001-08-21 12:23:31 +00:00
Søren Schmidt
468fe0fdf1 Finally commit some of the minor things I've collected over the last month(s):
Add tagged queueing support for new IBM drives.

Add support for Yet Another Promise ATA 100 chip.

Flush disk cache on close.

Dont flush the disk cache on BIO_ORDERED anymore.

Cleanup the tests for DMA on ATAPI devices.

Allow to share ALL irq's even the std irg 14 & 15.

Fix calculation bug in end of media code on CD's.

Add REZERO on opening a CDR/CDRW.

Cleanup ataioctl a bit.
2001-08-21 11:35:47 +00:00
John Baldwin
8ec48c6dbf - Remove asleep(), await(), and M_ASLEEP.
- Callers of asleep() and await() have been converted to calling tsleep().
  The only caller outside of M_ASLEEP was the ata driver, which called both
  asleep() and await() with spl-raised, so there was no need for the
  asleep() and await() pair.  M_ASLEEP was unused.

Reviewed by:	jasone, peter
2001-08-10 06:37:05 +00:00
Thomas Moestl
9c4968d152 Disallow ATAPI CD transfers that are not a multiple of the device block
size (previously, the transfer size would be rounded up to a multiple of
the block size, which would overflow the buffer).
This fixes panics when doing things like trying to mount audio CD's.

PR:		kern/21946
Review Timeout:	sos
2001-07-29 21:01:13 +00:00
Kris Kennaway
56bded8a29 s/adress/address/
Inspired by:    OpenBSD
MFC After:      1 week
2001-07-23 12:05:27 +00:00
Søren Schmidt
7aa30182a1 Add support for yet another Promise ATA100 variant
Minor fix to the VIA setup code.
2001-06-08 09:51:33 +00:00
Peter Wemm
0978669829 "Fix" the previous initial attempt at fixing TUNABLE_INT(). This time
around, use a common function for looking up and extracting the tunables
from the kernel environment.  This saves duplicating the same function
over and over again.  This way typically has an overhead of 8 bytes + the
path string, versus about 26 bytes + the path string.
2001-06-08 05:24:21 +00:00
Søren Schmidt
4dcb0f16ec Quiet the READ_TOC errors that can appear on empty CDR's.
Assure cur_write_speed can be no less than 177 to avoid divide by 0 error.
2001-06-07 07:21:20 +00:00
Peter Wemm
4422746fdf Back out part of my previous commit. This was a last minute change
and I botched testing.  This is a perfect example of how NOT to do
this sort of thing. :-(
2001-06-07 03:17:26 +00:00
Peter Wemm
81930014ef Make the TUNABLE_*() macros look and behave more consistantly like the
SYSCTL_*() macros.  TUNABLE_INT_DECL() was an odd name because it didn't
actually declare the int, which is what the name suggests it would do.
2001-06-06 22:17:08 +00:00
Søren Schmidt
28e3e06ebc Dont try to play tracks outside whats on the media.
PR 26647
2001-05-30 08:06:57 +00:00
Søren Schmidt
f8151fd3ce Update to support the NEC NR-7500A burners. 2001-05-30 07:28:57 +00:00
Søren Schmidt
490cf636a9 Fix bug in debug code 2001-05-29 17:27:36 +00:00
Søren Schmidt
c9cc17cc67 Fix for the fixate problem on the Yamaha burners. 2001-05-29 17:19:42 +00:00
Søren Schmidt
2c68839222 Update to use the changed ioctl interface. 2001-05-17 10:29:30 +00:00
Søren Schmidt
ef9988d058 Add support for the AMD 766 southbridge incl ATA100 support
Fix ATA66 mode for the AMD756, the timing was way to slow
2001-05-14 18:38:22 +00:00
Søren Schmidt
63e45b51b0 Remove the error var, it hides the real one.
PR 27213.

BTW the CDIOCREADAUDIO ioctl is deprecated, its not longer needed
and was an ugly hack from start on.
2001-05-09 13:01:10 +00:00
Poul-Henning Kamp
079f2df393 Make the disk mini-layer check for and handle zero-length transfers
instead of the underlying drivers.
2001-05-06 21:55:22 +00:00
Poul-Henning Kamp
a468031ce8 Actually biofinish(struct bio *, struct devstat *, int error) is more general
than the bioerror().

Most of this patch is generated by scripts.
2001-05-06 20:00:03 +00:00
Søren Schmidt
ed27f87339 Move the disklabel construction to the attach function instead of
in open. This prevent panics when a the disklabel is accessed on
an ATA-RAID subdisk.
2001-04-27 19:47:33 +00:00
Søren Schmidt
b952dabaa1 Add support the the Intel ICH2 mobile
Tidy chip name printing a bit.
2001-04-16 21:22:34 +00:00
Søren Schmidt
cffeef75e7 The VIA 586 chip does UDMA from rev 0x3 onwards.
MFC candidate!
2001-04-14 18:33:08 +00:00
Søren Schmidt
8018014f59 Add ATA66 and ATA100 mode support for Acer chipsets.
MFC candidate :)
2001-04-06 19:18:35 +00:00
Søren Schmidt
5e083a4a31 More error handling cleanups. 2001-04-05 15:45:53 +00:00
Søren Schmidt
268f572fab On burners that return faulty ready on fixate, wait for the
expected fixate time before returning.

Dont print error messages to the console on READ_TOC on
a blank media.
2001-04-05 11:17:33 +00:00
Søren Schmidt
ae2e8ffad0 Add new flag ATPR_F_QUIET to atapi_request.
Cleanup error handling.
2001-04-05 11:15:24 +00:00
Søren Schmidt
e65e827e13 Correct the sysctl names to match the tuneables.
Proberly flush the tag queue on detach.
2001-04-05 11:13:07 +00:00
Paul Saab
6b8b8c7fdc Last commit was broken.. It always prints '[CTRL-C to abort]'.
Move duplicate code for printing the status of the dump and checking
for abort into a separate function.

Pointy hat to:	me
2001-03-28 01:37:29 +00:00
Søren Schmidt
7acf4af808 Use PLAY_MSF instead of PLAY_BIG when doing audio play.
The fixes the problem of PLAY_BIG not being implemented on
some modern drives.

The problem now is that some old drives use BSD encoding
in the MSF case, which they dont tell, and which is also
not according to spec *sigh*. Hopefully there are not
too many of those still alive, or I hereby grant
license to kill the firmware writers that wrote the mess.
2001-03-27 10:22:50 +00:00
Paul Saab
f2a404d5a6 Change the dump routines to only abort if control-c is pressed.
If any other key is pressed, print a message stating that control-c
is how to abort.

Reviewed by:	peter
2001-03-27 06:24:08 +00:00
Poul-Henning Kamp
f83880518b Send the remains (such as I have located) of "block major numbers" to
the bit-bucket.
2001-03-26 12:41:29 +00:00
Søren Schmidt
312ec441cd Add bandaid to get ISA only systems to link. 2001-03-24 16:19:07 +00:00
Søren Schmidt
543ee068a7 Fix the problem with some drives not reporting back when the
are busy blanking and erasing CD-RW media.
This fixes burncd's premature returns from blanking/erasing
that caused trouble.
2001-03-23 20:55:28 +00:00
Søren Schmidt
0aef91a149 The size of the disk can't be gotten reliably with the read capacity
command, so use the info from the TOC instead.
2001-03-21 14:59:38 +00:00
Søren Schmidt
256d331f31 Set the device names as early as possible. 2001-03-21 11:49:07 +00:00
Søren Schmidt
68337c2c00 Handle the case where the last piece of a RAID0 (striped) disk is
not of interleave size.
2001-03-21 11:48:14 +00:00
Søren Schmidt
7ee5559aa7 Cleanup the diskerr messages a bit. 2001-03-21 11:46:15 +00:00
Søren Schmidt
7154fc7c7b Do not change/get mode on a nonexisting device. 2001-03-21 11:44:58 +00:00
Søren Schmidt
f74abb9b6e Try not to engage to ATA channels that are disabled by the BIOS. 2001-03-19 13:31:58 +00:00
Søren Schmidt
1ac2b9fe97 On open create all the CD physical track devices according to the
TOC read from the CD, instead of cloning them when asked to.
2001-03-19 12:02:36 +00:00
Søren Schmidt
895fd69a76 Only allow root to attach/detach/etc ATA/ATAPI devices. 2001-03-19 11:55:13 +00:00
Søren Schmidt
6eee1a1c12 Add sysctls for reading the tunables as suggested by des.
Minor cleanups plus checks of the ->active state.
Cosmetics.
2001-03-19 08:04:54 +00:00
Søren Schmidt
b5a5e99d51 Cleanup the alloc/release code a bit.
Fix length error on the bmio resource.

Fix the irq release code, zero out free'd irq.
2001-03-19 08:02:42 +00:00
Søren Schmidt
2149e3e372 Cosmetic changes. 2001-03-19 07:48:19 +00:00
Søren Schmidt
a2dca80a1d Provide the interface to atacontrol and associated logic.
see atacontrol(8) for more.

Also the ATA_ENABLE_ATAPI_DMA, ATA_ENABLE_WC and ATA_ENABLE_TAGS
options are gone, use the tuneables listed in ata.4 instead from
the loader (this makes it possible to switch off DMA before the
driver has to touch the devices on broken hardware).
2001-03-15 15:36:25 +00:00
Søren Schmidt
6c2cfc9203 Minor cleanup to the previous commit:
Print what devices went away and which arrived.

Avoid timeout loop on missing status.
2001-03-14 14:00:09 +00:00
Søren Schmidt
8fab4242e4 Add support for the IOMEGA Clik!
IOMEGA deserves a medal for making the most nonstandard ATAPI
devices, if they are ignorant or just not smart enough I don't
know, but somebody should help them out of their misery...
2001-03-14 12:12:46 +00:00
Søren Schmidt
8ea3ce2aac Refine the detach/attach code.
Proberly fail outstanding bio requests on devices that are detached.

This makes it possible to change between disk/cdrom/dvd/whathaveyou
in a notebook, just by suspending it, changing the device in the
bay (or what you model calls it), unsuspend and the ATA driver
will figure out what disappeared and properly fail those, and attach
any new devices found.
2001-03-14 12:05:44 +00:00
Søren Schmidt
331c488d69 Split out the ata probes in seperate files for each bus type. 2001-03-06 21:43:46 +00:00
Søren Schmidt
e0db7375ba Cosmetic change to the probe printf's 2001-03-06 09:42:46 +00:00
Mark Murray
7547eefdf3 Set the interrupt-harvesting bit for those hardware items that I
can actually test.

Nothing will happen until the sysadmin turns on intr-harvesting
on her computer.
2001-02-18 18:02:15 +00:00
Søren Schmidt
df17ff7fa5 Oops, its no longer NISA its DEV_ISA, sigh.... 2001-02-12 14:29:13 +00:00
Søren Schmidt
7dd6c38875 Dont rely on isa includes to get at the std port adresses. 2001-02-12 10:18:59 +00:00
Søren Schmidt
c856ce5777 Print out sensekey specifik values if set on error 2001-02-12 08:34:07 +00:00
Søren Schmidt
b6268bb5e2 Properly report the VIA '586 type. 2001-02-12 08:33:28 +00:00
Søren Schmidt
32565eb8c5 Fix a memory leak.
Pointed out by: Asmodai
2001-02-08 21:59:27 +00:00
Søren Schmidt
b17f7a1aa5 Introduce busspace instead of the good old in/out instructions.
Not pretty but it works (I hope)...
2001-02-06 16:44:25 +00:00
Søren Schmidt
dbb5bf4bf6 Damn! that was the wrong patch! get it right this time.... 2001-02-06 12:49:33 +00:00
Søren Schmidt
06a519dfc9 Fix the clone functionality in atapi-cd, it didn't work for
devs other than the first, and allowed to clone a nonexistent
device..
2001-02-06 12:41:53 +00:00
Søren Schmidt
6fe4e0a915 Add option ATA_ENABLE_WC for enabling write caching (now off by default). 2001-01-29 18:00:35 +00:00
Peter Wemm
358f1800c0 Convert ata and atapi #if NATA* > 0 to options instead. Stop config
trying to count the number of ata* devs since they were not used anyway.
2001-01-29 10:01:11 +00:00
Peter Wemm
03927d3c33 Send "#if NISA > 0" to the bit-bucket and replace it with an option.
These were compile-time "is the isa code present?" tests and not
'how many isa busses' tests.
2001-01-29 09:38:39 +00:00
Søren Schmidt
98e1287686 Correct botchup in last commit that made older VIA chips fail... 2001-01-21 16:13:03 +00:00
Peter Wemm
c90137a386 Zap #include "apm.h" - it was not used. 2001-01-19 13:53:54 +00:00
Søren Schmidt
df32668400 When blocksize is set to 2352, alwas read 2352 bytes.
This means it might read more than just data, but that is exactly
what we want here (for reading VCD's fx)
2001-01-18 15:20:18 +00:00
Søren Schmidt
af152621e5 Add first cut support for the ATA100 capable VIA82c686b. 2001-01-17 09:22:13 +00:00
Søren Schmidt
3ce9aa9100 Use prober atomic operations when test&set'ing ->active.
This turns some of my lockups under SMP into spontanious reboots...
2001-01-14 19:36:20 +00:00
Søren Schmidt
95eaffae1b Add session argument to *close_disk, allowing to set session type on fixate.
Add support for different blank/erase types.

Update headers.
2001-01-10 19:19:47 +00:00
Søren Schmidt
82cf4d7ae2 Back out the "close tray on open" feature, its not clear what
color it should have...
2001-01-08 21:34:25 +00:00
Søren Schmidt
bd442d2547 Try better this time at a patch that properly backspeeds on the Acer chips. 2001-01-07 17:00:09 +00:00
Søren Schmidt
dc194d46e4 On open try to close the drivetray and wait for drive ready.
Idea from PR24109 but implemented differently
2001-01-07 16:48:56 +00:00
Søren Schmidt
f0915b3708 Oops the test in the Acer code should be >= not >. 2001-01-05 15:23:06 +00:00
Søren Schmidt
b4de9f62a4 Add support for using BurnProff(tm) on drives that support it.
This is experimental as I dont have such a drive, reports welcome!!
2001-01-04 12:43:39 +00:00
Søren Schmidt
6ddc41c034 Proberly calculate the RAID structure on the Promise Fasttrak. 2001-01-04 09:11:00 +00:00
Søren Schmidt
6cf4911dd6 Use M_ZERO flag on malloc when approbiate. 2000-12-26 12:05:49 +00:00
Søren Schmidt
dec35f9164 Update the burncd interface a bit, dont block the ATA channel on
blank & fixate commands and provide a progress interface for the
blank command (for now)
2000-12-26 11:55:44 +00:00
Søren Schmidt
ce3598adfe Use diskerr for printing disk hard/soft errors. 2000-12-26 11:49:57 +00:00
Søren Schmidt
43a181118f Proberly back down DMA modes on the Acer Aladdin. 2000-12-19 10:37:03 +00:00
Poul-Henning Kamp
959b7375ed Staticize some malloc M_ instances. 2000-12-08 20:09:00 +00:00
Søren Schmidt
374940a184 Fix a braino .. 2000-11-18 12:14:35 +00:00
Søren Schmidt
18434d5214 Put the probe verboseness behind bootverbose 2000-11-16 10:52:00 +00:00
Søren Schmidt
0cdc179319 Only offset raid disks > 1 on the HPT, this should solve the
boot problems..
However this demands that dangerously dedicated disks use an
offset of at least 10 from the start to not overwrite the
raid config sector on the HPT...
2000-11-12 20:45:14 +00:00
Søren Schmidt
07296bbba1 Better handling of immediate commands, mainly to solve timeouts
in the atapi-tape code...
2000-11-12 20:41:24 +00:00
Søren Schmidt
a9c1b0e23a Hopefully fix the probing problems that caused lost slaves etc.. 2000-11-12 20:40:05 +00:00
Søren Schmidt
1716750c65 Rearrange the timeouts in the reset code a bit, some ATAPI devices
are picky about this.
2000-11-08 21:25:43 +00:00
Søren Schmidt
30a777baa8 Hopefully solve the lost slave problem. 2000-11-08 19:31:39 +00:00
Søren Schmidt
4ce977b412 Fix breakage on some ATA chips that dont have busmastering set.
Tidy up the probe a bit..
2000-11-03 17:09:34 +00:00
Søren Schmidt
6cc33af8f1 Update the config gathering code for both Promise & HPT 2000-11-01 17:35:44 +00:00
Søren Schmidt
afaa0eb776 Try a bit harder to test for ATA/ATAPI HW to probe, this is to avoid
some of the false comrades some devices fakes...
2000-10-30 20:45:24 +00:00
Søren Schmidt
92be7ac569 Update the Promise RAID code, there are differences between BIOS
version unfortunately...
2000-10-30 17:11:40 +00:00
Søren Schmidt
0dbc12d8ca Fix the PCCARD ATA breakage..
This is due to a bug that has been in there since Warneer did the
PCCARD stuff, the altioaddr is not offset 8 its offset 14 from
the base address.
Also only probe the master device, no known PCCARD ATA thingies
has a slave AFAIK..
2000-10-30 09:36:40 +00:00
Poul-Henning Kamp
cf9fa8e725 Move suser() and suser_xxx() prototypes and a related #define from
<sys/proc.h> to <sys/systm.h>.

Correctly document the #includes needed in the manpage.

Add one now needed #include of <sys/systm.h>.
Remove the consequent 48 unused #includes of <sys/proc.h>.
2000-10-29 16:06:56 +00:00
Søren Schmidt
7f7e251f51 Fix the problem with DMA mode not working on Aladdin chips.
Amasing in how many ways Acer has screwed up that chip.
2000-10-24 13:50:22 +00:00
Søren Schmidt
0f4eed7d8b Clean up the raid code a bit, also allow disks on HPT controllers to
be swapped around and still be put in the correct order in a raid.
2000-10-22 12:17:57 +00:00
Søren Schmidt
7dda7872cb Fix warning in the ISA only case. 2000-10-22 12:17:38 +00:00
Søren Schmidt
8f281eed6c Get the prober error code instead of relying on scp->error to contain
the lastest greatest.
2000-10-22 12:16:51 +00:00
Søren Schmidt
d29f653d3a Up the reset pulse to 100ms in ata_reset, some drives especially
DVD drives need this to reset proberly.

Remove some verboseness..
2000-10-22 12:16:00 +00:00
John Baldwin
0cfbef3288 Quiet a silly warning.
Pointy-hat to:	ps
2000-10-19 18:52:20 +00:00
Søren Schmidt
550abec2a0 Minor changes to the ATA RAID support code, remove some verbosity
and put some under bootverbose..
2000-10-18 18:49:42 +00:00
Paul Saab
c794ceb56a Implement write combining for crashdumps. This is useful when
write caching is disabled on both SCSI and IDE disks where large
memory dumps could take up to an hour to complete.

Taking an i386 scsi based system with 512MB of ram and timing (in
seconds) how long it took to complete a dump, the following results
were obtained:

Before:				After:
	WCE           TIME		WCE           TIME
	------------------		------------------
	1	141.820972		1	 15.600111
	0	797.265072		0	 65.480465

Obtained from:	Yahoo!
Reviewed by:	peter
2000-10-17 10:05:49 +00:00
Poul-Henning Kamp
db7e3af111 Remove unneeded #include <machine/clock.h> 2000-10-15 14:19:01 +00:00
Paul Saab
16a011f973 Do not allocate a callout for all crashdumps, not just when you panic. 2000-10-13 21:49:19 +00:00
Søren Schmidt
e9cf6115e4 Add support for ATA "pseudo" RAID controllers as the Promise Fasttrak
and HighPoint HPT370 controllers.

Use by defining the RAID in the BIOS and the "ar driver will pick it up
automagically...
2000-10-13 13:04:45 +00:00
Søren Schmidt
8d8f318a08 Fix ISA only systems. 2000-10-13 12:09:23 +00:00
Søren Schmidt
2c483f9eb5 Get rid of the ivars entirely. 2000-10-13 11:21:27 +00:00
Søren Schmidt
b656ee68ec Only allow UDMA2 mode on SiS rev > 0xc1
Minor cosmetics
2000-10-13 10:54:47 +00:00
John Baldwin
1931cf940a - Heavyweight interrupt threads on the alpha for device I/O interrupts.
- Make softinterrupts (SWI's) almost completely MI, and divorce them
  completely from the x86 hardware interrupt code.
  - The ihandlers array is now gone.  Instead, there is a MI shandlers array
    that just contains SWI handlers.
  - Most of the former machine/ipl.h files have moved to a new sys/ipl.h.
- Stub out all the spl*() functions on all architectures.

Submitted by:	dfr
2000-10-05 23:09:57 +00:00
Søren Schmidt
11b944d47a Cleanup the chipset specific interrupt code a bit. 2000-10-05 08:28:06 +00:00
Søren Schmidt
9b09a33635 Fix the MASTERDEV breakage the caused the PIIX controllers to get
missed in the probe. This might break the CMD chips again, more
testing is needed on that, but we need the mainstream chips to
work again ...
2000-10-04 08:28:37 +00:00
Søren Schmidt
162080b465 Add support for ServerWorks ROSB4 ATA33 chipset.
Add support for CMD 648 ATA66 & CMD 649 ATA100 chipsets.

Fix the "resource already allocated" panic with the CMD and other
braindead controllers.

Add options ATA_ENABLE_TAGS, without this option tagged queuing will
not be attempted.
2000-10-03 13:12:36 +00:00
Doug Rabson
f6174366bf Make the alpha hacks dependant on __alpha__ instead of !__i386__. 2000-09-29 16:50:31 +00:00
Søren Schmidt
511e9e7251 Fix the breakage that snatched the ioports from the fdc device.
Fix promise support.
2000-09-24 18:19:43 +00:00
Søren Schmidt
c50cf4ac06 Remove unneeded includes
Pointed out by: phk
2000-09-20 07:00:24 +00:00
Søren Schmidt
8563f77dc9 Add support for tagged queuing on ATA drives. There is only support for
IBM's DPTA and DTLA series of drives (no other disk vendors are known
to support this) on non-Promise controllers (promise controllers lockup
when given the tagged queuing specific commands).
It gives especially master/slave comboes about 5% better performance.

Add support for the Promise ATA100 OEM chip (pdc20265)

Add support for the Cyrix 5530

Change the way status is read from the drives, use the alternate
status reg when possible.

Better support for DEVFS, the acdXtY devices are now created when needed.

Lots of little cleanups.
2000-09-19 11:08:39 +00:00
Søren Schmidt
53d07b1ebb Only read to the end of the select track. 2000-09-18 12:13:32 +00:00
John Baldwin
9a94c9c5c3 - Remove the inthand2_t type and use the equivalent driver_intr_t type from
newbus for referencing device interrupt handlers.
- Move the 'struct intrec' type which describes interrupt sources into
  sys/interrupt.h instead of making it just be a x86 structure.
- Don't create 'ithd' and 'intrec' typedefs, instead, just use 'struct ithd'
  and 'struct intrec'
- Move the code to translate new-bus interrupt flags into an interrupt thread
  priority out of the x86 nexus code and into a MI ithread_priority()
  function in sys/kern/kern_intr.c.
- Remove now-uneeded x86-specific headers from sys/dev/ata/ata-all.c and
  sys/pci/pci_compat.c.
2000-09-13 18:33:25 +00:00
Jason Evans
0384fff8c5 Major update to the way synchronization is done in the kernel. Highlights
include:

* Mutual exclusion is used instead of spl*().  See mutex(9).  (Note: The
  alpha port is still in transition and currently uses both.)

* Per-CPU idle processes.

* Interrupts are run in their own separate kernel threads and can be
  preempted (i386 only).

Partially contributed by:	BSDi (BSD/OS)
Submissions by (at least):	cp, dfr, dillon, grog, jake, jhb, sheldonh
2000-09-07 01:33:02 +00:00
Doug Rabson
21c3015a24 * Completely rewrite the alpha busspace to hide the implementation from
the drivers.
* Remove legacy inx/outx support from chipset and replace with macros
  which call busspace.
* Rework pci config accesses to route through the pcib device instead of
  calling a MD function directly.

With these changes it is possible to cleanly support machines which have
more than one independantly numbered PCI busses. As a bonus, the new
busspace implementation should be measurably faster than the old one.
2000-08-28 21:48:13 +00:00
Søren Schmidt
b0bb0aeb95 Rearrange the probe a bit, hopefully this will help to eleminate
some of the fake devices sometimes seen on single device ATA
channels.

Proberly fail on failures in ata-disk.c, retry instead of hang.

Cleanup the VIA probe/init code a bit.

Fix a couble of missing free's in atapi-cd.c in the changer code.
2000-08-16 07:09:04 +00:00
Søren Schmidt
710591b796 Fix off by one error in track# calculation. 2000-08-13 09:08:19 +00:00
Søren Schmidt
ae97e232fb Backout the tsleep on probe, it breaks in resume mode as tsleep
not always has a context to sleep on.
Back to the drawing board...
2000-08-11 10:34:22 +00:00
Søren Schmidt
071e6e581e Add support for accessing individual tracks on a CD.
This is done by misusing the device minor a bit to encode the
track no there.

So to read track #4 just use /dev/acdNt4 where N is the device #.

The driver no automatically sets the blocksize (sectorsize) to
what the track is set to in the TOC.

This has the nice effect that you can now rip audioi tracks
by simply doing:

dd if=/dev/acdNt2 of=audiotrack2.raw bs=2352

it cant be much simpler than that :)

NOTE: the original acdNa & acdNc device still work as usual,
except the blocksize is set according to track0.
2000-08-11 09:21:36 +00:00
Søren Schmidt
4466a3504d Fix the ICH2 ATA100 support, and proberly downgrade the chip setup when
going to slower DMA modes on all Intel chips.
2000-08-10 07:34:49 +00:00
Søren Schmidt
bfc0a42650 Fix braino in the tsleep call, ata_delayed_attach might be a NULL
pointer..
2000-08-08 14:57:36 +00:00
Søren Schmidt
ab418d7db3 Add experimental code for ATA100 support on:
Promise Ultra100 / Fasttrak100
HighPoint HPT370 controllers (fx Abit KA7-100 onboard ctrl, Abit HotRod 100)
Intel ICH2 (Intel 815E based motherboards)

So far I can read >90MB/s on the Promise and the HPT370.
I can write >64MB/s on the promise and >50MB/s on the HPT370 so it seems
writing is still done in ATA66 mode :(
The ICH2 support is untested as of yet...
2000-08-06 19:51:58 +00:00
Søren Schmidt
19095fd23c Use tsleep instead od DELAY in probe when not in boot.
This fixes the uptil 30s hangs on PCCARD ata device probes.
2000-08-06 19:10:05 +00:00
Søren Schmidt
0ec4d7b5b0 Remove sequence checking in the burner support.
This was really a leftover from the wormcontrol days, it is no longer
needed when using burncd.
2000-08-06 18:03:42 +00:00
Søren Schmidt
e7d1a5c2b1 Be a bit more restrictive in using multisector transfers. 2000-08-06 18:01:47 +00:00
Steve Price
bf11d3dcda Spell the word 'limited' with only one 't'. 2000-07-30 17:54:34 +00:00
Poul-Henning Kamp
77978ab8bc Previous commit changing SYSCTL_HANDLER_ARGS violated KNF.
Pointed out by:	bde
2000-07-04 11:25:35 +00:00
Poul-Henning Kamp
82d9ae4e32 Style police catches up with rev 1.26 of src/sys/sys/sysctl.h:
Sanitize SYSCTL_HANDLER_ARGS so that simplistic tools can grog our
sources:

        -sysctl_vm_zone SYSCTL_HANDLER_ARGS
        +sysctl_vm_zone (SYSCTL_HANDLER_ARGS)
2000-07-03 09:35:31 +00:00
Poul-Henning Kamp
4bd02a5609 Add disk_enumerate() for finding names of disks. Vinum and libh will
need this RSN.

Remove a pointless warning in the root device locating code.

Remove the "wd" compatibility name from the "ad" driver.

WARNING: If you have not updated to use /dev/wd* in your /etc/fstab
and modern bootblocks, it would be a very good idea to do so BEFORE
you upgrade your kernel.
2000-06-15 20:30:53 +00:00
Doug Rabson
1536418a84 Brucify the pmap_enter_temporary() changes. 2000-05-29 19:21:01 +00:00
Doug Rabson
31891bc2bd Add a new pmap entry point, pmap_enter_temporary() to be used during
dumps to create temporary page mappings. This replaces the use of CADDR1
which is fairly x86 specific.

Reviewed by: dillon
2000-05-28 15:49:55 +00:00
Søren Schmidt
724a60faf8 Cosmetics: dont say Unknown but Generic chipset in probe.. 2000-05-28 07:51:23 +00:00
Søren Schmidt
5158543d6a Fix alignment problem on the alpha reported by several parties. 2000-05-28 07:50:19 +00:00
Jake Burkholder
e39756439c Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by:		msmith and others
2000-05-26 02:09:24 +00:00
Jake Burkholder
740a1973a6 Change the way that the queue(3) structures are declared; don't assume that
the type argument to *_HEAD and *_ENTRY is a struct.

Suggested by:	phk
Reviewed by:	phk
Approved by:	mdodd
2000-05-23 20:41:01 +00:00
Søren Schmidt
5996ceaaa9 Fix a nasty bug in ata_intr, parens are a good thing if used right.
Make the error recovery code a little more obvious.

Inform the user if UDMA66 mode couldn't be selected due to a
non ATA66 compliant 80pin cable.

Minor cosmetics.
2000-05-23 19:05:56 +00:00
Peter Wemm
0385347c1a Implement an optimization of the VM<->pmap API. Pass vm_page_t's directly
to various pmap_*() functions instead of looking up the physical address
and passing that.  In many cases, the first thing the pmap code was doing
was going to a lot of trouble to get back the original vm_page_t, or
it's shadow pv_table entry.

Inspired by: John Dyson's 1998 patches.

Also:
Eliminate pv_table as a seperate thing and build it into a machine
dependent part of vm_page_t.  This eliminates having a seperate set of
structions that shadow each other in a 1:1 fashion that we often went to
a lot of trouble to translate from one to the other. (see above)
This happens to save 4 bytes of physical memory for each page in the
system.  (8 bytes on the Alpha).

Eliminate the use of the phys_avail[] array to determine if a page is
managed (ie: it has pv_entries etc).  Store this information in a flag.
Things like device_pager set it because they create vm_page_t's on the
fly that do not have pv_entries.  This makes it easier to "unmanage" a
page of physical memory (this will be taken advantage of in subsequent
commits).

Add a function to add a new page to the freelist.  This could be used
for reclaiming the previously wasted pages left over from preloaded
loader(8) files.

Reviewed by:	dillon
2000-05-21 12:50:18 +00:00
Poul-Henning Kamp
9626b608de Separate the struct bio related stuff out of <sys/buf.h> into
<sys/bio.h>.

<sys/bio.h> is now a prerequisite for <sys/buf.h> but it shall
not be made a nested include according to bdes teachings on the
subject of nested includes.

Diskdrivers and similar stuff below specfs::strategy() should no
longer need to include <sys/buf.> unless they need caching of data.

Still a few bogus uses of struct buf to track down.

Repocopy by:    peter
2000-05-05 09:59:14 +00:00
Søren Schmidt
af5bd99e9a Fix for the HP burners (and possibly other broken drives to)
that fails to proberly close the disk.
The problem seems to be that the HP burners sometimes return
ready when they actually are not, the solution is to not use
immediate mode on the closing commands. This is suboptimal
for real burners, in that they now hog the ATA bus for possibly
minutes, where its really not nessesary, *sigh*.
2000-05-01 07:30:28 +00:00
Poul-Henning Kamp
67f3c95cf9 Clone the {b|bio}_offset field, and make sure it is always initialized
in struct bio.  Eventually, bio_offset will probably obsolete the
bio_blkno and bio_pblkno fields.

Remove the special hack in atapi-cd.c to determine of bio_offset was valid.
2000-04-25 10:51:18 +00:00
Poul-Henning Kamp
ed6aff7387 Remove unneeded <sys/buf.h> includes.
Due to some interesting cpp tricks in lockmgr, the LINT kernel shrinks
by 924 bytes.
2000-04-18 15:15:39 +00:00
Poul-Henning Kamp
8177437d85 Complete the bio/buf divorce for all code below devfs::strategy
Exceptions:
        Vinum untouched.  This means that it cannot be compiled.
        Greg Lehey is on the case.

        CCD not converted yet, casts to struct buf (still safe)

        atapi-cd casts to struct buf to examine B_PHYS
2000-04-15 05:54:02 +00:00
Søren Schmidt
4175758a2d Add support for ATA66 on newer revisions of the VIA 82C596 2000-04-09 15:08:27 +00:00
Poul-Henning Kamp
c244d2de43 Move B_ERROR flag to b_ioflags and call it BIO_ERROR.
(Much of this done by script)

Move B_ORDERED flag to b_ioflags and call it BIO_ORDERED.

Move b_pblkno and b_iodone_chain to struct bio while we transition, they
will be obsoleted once bio structs chain/stack.

Add bio_queue field for struct bio aware disksort.

Address a lot of stylistic issues brought up by bde.
2000-04-02 15:24:56 +00:00
Søren Schmidt
eae50c69b3 Correct a mishap in phk's BIO_* changes. 2000-03-26 12:01:27 +00:00
Søren Schmidt
8c918526a5 Fix the panic occuring on non-changer devices. 2000-03-24 07:44:20 +00:00
Søren Schmidt
c481f1fa74 Make ATAPI CD changer devices work, hopefully better than before. 2000-03-21 13:26:54 +00:00
Poul-Henning Kamp
21144e3bf1 Remove B_READ, B_WRITE and B_FREEBUF and replace them with a new
field in struct buf: b_iocmd.  The b_iocmd is enforced to have
exactly one bit set.

B_WRITE was bogusly defined as zero giving rise to obvious coding
mistakes.

Also eliminate the redundant struct buf flag B_CALL, it can just
as efficiently be done by comparing b_iodone to NULL.

Should you get a panic or drop into the debugger, complaining about
"b_iocmd", don't continue.  It is likely to write on your disk
where it should have been reading.

This change is a step in the direction towards a stackable BIO capability.

A lot of this patch were machine generated (Thanks to style(9) compliance!)

Vinum users:  Greg has not had time to test this yet, be careful.
2000-03-20 10:44:49 +00:00
Søren Schmidt
2a14fd50d9 Remove the old DSC code, it doesn't work anymore. 2000-03-18 22:42:45 +00:00
Søren Schmidt
0d611a6c29 Cleanup sweep. 2000-03-13 12:27:11 +00:00
Søren Schmidt
cfb21bbb7d Enable disksort the right way both on ATA disks and ATAPI devices. 2000-03-13 12:04:58 +00:00
Søren Schmidt
8048917432 Backout the previous fix, it is _not_ that easy too fix.
Leave it as is for 4.0 the real solution comes later.
2000-03-13 09:10:25 +00:00
Søren Schmidt
4c435787ab Dont call ad_start unless the controller is idle.
This effectively nullified the usefullness of disksort().
2000-03-12 13:56:05 +00:00
Søren Schmidt
924f6734a5 Cosmetics.. 2000-03-10 22:10:34 +00:00
Søren Schmidt
643b70ec9d Dont call make_dev until we are sure the device is there, this prevents
panic'ing when the device is tried accessed later.
2000-03-10 08:09:53 +00:00
Søren Schmidt
aaa29cf209 Fix the CD driver so that the last blocks can be read even if
a blocksize != 2k is used.
Update the timeout code to try fallback to PIO if problems
arise in DMA mode.
2000-03-05 16:52:26 +00:00
Søren Schmidt
b744c0fdc6 Spell construct right. 2000-03-01 14:39:51 +00:00
Søren Schmidt
7caf73fb3c Add DVD-RAM support.
The driver constructs a fake disklabel that makes the 'a' partition
cover the entire DVD-RAM disk. This cannot be changed from the user
side. This solution was chosen because most DVD-RAM will have a
UDF (or until we have that CD9660) filesystem on it covering the
entire disk, its not really thought as a real random access device.

This might change over time, but for now this is what we have, and
it is compatible with CDROM's etc, that makes using the minidisk
subsystem less than ideal, because of !modulo BDEV_SIZE blocks.
2000-02-29 22:00:53 +00:00
Søren Schmidt
41ef40c93d Only read user data when blocksize != 2048, this "read the works"
sneaked in sometime which is not what the average user wants.
2000-02-29 16:11:18 +00:00
Søren Schmidt
cb66e8d4e3 Fix the problem that caused the boot to fail when modules were loaded.
Real braino, confuses two different softc types, I wonder how this
could ever work :(
2000-02-27 12:41:07 +00:00
Søren Schmidt
1a488af60f Add (partial) support for the Cypress ATA controller.
Call intr_teardown on detach.

Always add non masterdevice from unit 2 upwards.

Update to the pccard code, at least some cards are now working,
more testing to follow.
2000-02-25 09:48:23 +00:00
Søren Schmidt
9bd1c89ad3 Add UDMA66 support to the Intel ICH chip.
Submitted by: sakichan@lares.dti.ne.jp
2000-02-22 20:37:01 +00:00
Søren Schmidt
456b5ad253 Fix the changer code, dont wait for device ready on unload, it
wont become ready as there is no media - doh.

Update the command name reporting.
2000-02-21 18:41:05 +00:00
Søren Schmidt
47351d2774 Update the ata driver to take more advantage of newbus, this
was needed to make attach/detach of devices work, which is
needed for the PCCARD support.
(PCCARD support is still not working though, more to come on that)

Support the CMD646 chip which is used on many alphas, sadly only
in WDMA2 mode, as the silicon is broken beyond belief for UDMA modes.

Lots of cosmetic fixes here and there.

Sorry for the size of this megapatchfromhell but it was not
possible otherwise...

newbus patches based on work from: dfr (Doug Rabson)
2000-02-18 20:57:33 +00:00
Søren Schmidt
32c3d17908 That "NO DRIVER" panic fix wasn't good enough... 2000-02-11 07:37:00 +00:00
Søren Schmidt
1af69d6936 Probe cosmetics. 2000-02-08 18:38:39 +00:00
Søren Schmidt
cc8baa1136 The bde script has a bug, I used a patch from it verbatim, bad idea....
Fixed...
2000-02-08 16:39:11 +00:00
Søren Schmidt
e8359a57de Do refcounting of open devices (more) correctly.
count_dev funtion by phk.
2000-02-07 23:05:40 +00:00
Søren Schmidt
a9ec39136b Dont panic if no sub-driver is found. 2000-02-07 22:57:11 +00:00
Søren Schmidt
77145a3388 Unbreak addump, now dumping works again. 2000-02-07 22:56:32 +00:00
Søren Schmidt
96ebd6d1fc fix support for shared IRQ's.
fix support for multiple HPT & Promise controllers.

support mixed 33/66 devices on the Promise 66 controllers.

fix the refcount stuff in the atapi drivers.

misc cleanups.
2000-02-04 10:20:22 +00:00
Søren Schmidt
4de1cbfab9 cosmetic changes only. 2000-01-29 22:38:36 +00:00
Søren Schmidt
eff43d0e8a cosmetic changes only. 2000-01-29 14:10:59 +00:00
Søren Schmidt
a4fec20898 Get the MEDIA_CHANGED status right here too. 2000-01-28 22:17:29 +00:00
Søren Schmidt
211a760057 Use atapi_test_ready not atapi_wait_ready, I need more sleep :( 2000-01-28 21:30:31 +00:00
Søren Schmidt
78e0324341 Get the MEDIA_CHANGED status right. 2000-01-28 21:03:25 +00:00
Søren Schmidt
0b905b407e Fix the atapi-fd.c (afd device) so that fx MSDOS formatted ZIP
disks can be mounted. Use b_pblkno instead of b_blkno

Found by: phk

Protect (proberly) against setting modes on nonexisting devices.
2000-01-28 20:18:19 +00:00
Søren Schmidt
96478887ff Fix compilation on ISA only setups... 2000-01-28 15:57:13 +00:00
Søren Schmidt
02ce0452e1 Cleanup the ata_dmainit function a bit.
Also allow BIOS setup DMA on unknown controllers.
2000-01-28 13:35:43 +00:00
Søren Schmidt
6a7f51845b Oops, fix compile error due to the new way of storing the transfer mode. 2000-01-28 08:03:21 +00:00
Søren Schmidt
0fd4327bb6 Add sysctl oid hw.atamodes to set the transfermodes online. 2000-01-27 19:00:51 +00:00
Søren Schmidt
0817db9f98 Retry a bit more agressively on the atapi identify.
Try to support older systems reporting irq0 for the first channels.

Support sharing of the std interrupts (says peter :) )

Dont use READ_CD on normal data reads (2048 bytes), too many old drives
doesn't support this command even if the std says "shall" :(, but still
use READ_CD on all other blocksizes.

Add the geometry to the ad probe, its still usefull.
2000-01-25 20:14:51 +00:00