Commit Graph

375 Commits

Author SHA1 Message Date
mike
99e543a853 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
sos
57865251c8 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
sos
b45627b32f 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
sos
1e8f208d95 Add a couble more Promise chip ID's. 2002-04-12 14:10:19 +00:00
sos
05bab27f80 Add yet another chip ID for a Promise TX2 chip. 2002-04-11 11:04:23 +00:00
sos
03183c74c3 Only calculate Promise magic if a device is there for info. 2002-04-11 08:52:32 +00:00
sos
8928105d97 Fix the FreeBSD native ATA RAID code a bit. 2002-04-10 11:18:07 +00:00
sos
5b5bb6df40 Add yet another ATA133 Promise chip. 2002-04-07 07:53:34 +00:00
sos
7c1178a001 Unlock the channel again if an ata_reinit() fails. 2002-04-05 18:37:04 +00:00
sos
0eb324033d Change option ATA_ENABLE_BUSMASTER into ifdef __sparc64__ 2002-04-05 18:05:17 +00:00
sos
dfb0853c77 Cleanups. 2002-04-05 18:04:05 +00:00
sos
4059babc8f Dont allow to detach twice. 2002-04-05 18:02:33 +00:00
sos
09d26f1006 Add forgotten ATA_UNLOCK_CH when getting status from non-existing
enclosure.
2002-04-05 15:58:45 +00:00
sos
0d2605253b 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
sos
9bb1e67e7e Correct the Northbridge test on the new ATA133 VIA's
Misc cosmetics now I'm there.
2002-04-02 16:45:06 +00:00
sos
9b962a4e9b Add get-status to the ATA RAID subsystem. 2002-04-02 13:48:17 +00:00
phk
4d586060a3 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
jhb
dc2e474f79 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
phk
ef82a51634 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
sos
d5be9373bd ATA100 is allowed on the HPT chips rev >= 3 2002-03-31 13:33:55 +00:00
sos
23978f436e Remove debug output in last commit. 2002-03-30 16:51:47 +00:00
sos
65dd7ee2d6 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
sos
0fb3c06959 Use the raid lun not the magic when writing Promise config. 2002-03-30 11:15:46 +00:00
sos
b9999a8c7c Fix a braino, only update LED's when a device is present. 2002-03-28 11:48:36 +00:00
sos
133e8d001c 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
sos
dab6051552 Fix support for multi CD changers, it was as broken as my old NEC :)
MFC: ASAP

:
2002-03-27 19:47:52 +00:00
sos
3bb9163271 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
sos
cf912d2e7a Misc little cleanups. 2002-03-26 09:31:22 +00:00
sos
87ccc1e6f1 Add AMD 768 support. 2002-03-24 12:44:23 +00:00
peter
83e5f60722 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
sos
7e8e9c2947 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
sos
7f79fcc8da Add support for the ServerWorks CSB5 chips 2002-03-18 12:13:13 +00:00
sos
515ba9517a Add more functionality to the CDIOCREADSUBCHANNEL ioctl.
PR: 26644
2002-03-16 15:56:54 +00:00
sos
2b25f973e2 Fix 64bit arch problems. 2002-03-16 15:55:20 +00:00
sos
7a533342ff Remove useless splXXX set. 2002-03-16 15:54:41 +00:00
sos
66c17217fb Update to the RAID1 rebuild code.
Run rebuild as a background process.

Sponsored by: Advanis
2002-03-15 15:39:54 +00:00
sos
33c882b814 Unbreak the probing of some CDROM drives. 2002-03-14 21:35:55 +00:00
sos
2bbd43c8f1 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
sos
2420c1b451 Silence a warning when compile without atapi devices. 2002-03-10 21:03:04 +00:00
sos
259c8e6d53 Even more Highpoint RAID support.
Fix the 80pin cable detection system.
2002-03-08 21:36:49 +00:00
sos
0b0678b193 Support newer Highpoint BIOS's extended config. 2002-03-08 11:33:52 +00:00
sos
a4b9448d10 cosmetics 2002-03-08 11:31:37 +00:00
sos
15f98e2cbc Oops I mixed up the patch for -current & -stable, sorry .... 2002-03-07 19:20:23 +00:00
sos
fb90ee5e0b Minor cosmetic changes to minimise diffs for MFC. 2002-03-07 16:34:19 +00:00
sos
23058273ee Fix a couble of bugs in the rebuild code, return errors properly. 2002-03-07 16:32:21 +00:00
bde
f639b7649f 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
sos
9efc11065b 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
sos
d3537063e7 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
sos
8703cd1dab 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
bde
6c8918fd14 Fixed a printf format error. 2002-03-02 10:54:33 +00:00