Commit Graph

77 Commits

Author SHA1 Message Date
Poul-Henning Kamp
7812d86f03 (This commit touches about 15 disk device drivers in a very consistent
and predictable way, and I apologize if I have gotten it wrong anywhere,
getting prior review on a patch like this is not feasible, considering
the number of people involved and hardware availability etc.)

If struct disklabel is the messenger: kill the messenger.

Inside struct disk we had a struct disklabel which disk drivers used to
communicate certain metrics to the disklayer above (GEOM or the disk
mini-layer).  This commit changes this communication to use four
explicit fields instead.

Amongst the benefits is that the fields do not get overwritten by
wrong or bogus on-disk disklabels.

Once that is clear, <sys/disk.h> which is included in the drivers
no longer need to pull <sys/disklabel.h> and <sys/diskslice.h> in,
the few places that needs them, have gotten explicit #includes for
them.

The disklabel inside struct disk is now only for internal use in
the disk mini-layer, so instead of embedding it, we malloc it as
we need it.

This concludes (modulus any mistakes) the series of disklabel related
commits.

I belive it all amounts to a NOP for all the rest of you :-)

Sponsored by:   DARPA & NAI Labs.
2002-09-20 19:36:05 +00:00
Poul-Henning Kamp
f90c382c0c Make FreeBSD "struct disklabel" agnostic, step 311 of 723:
Rename diskerr() to disk_err() for naming consistency.

Drop the by now entirely useless struct disklabel argument.

Add a flag argument for new-line termination.

Fix a couple of printf-format-casts to %j instead of %l.

Correctly print the name of all bio commands.

Move the function from subr_disklabel.c to subr_disk.c,
and from <sys/disklabel.h> to <sys/disk.h>.

Use the new disk_err() throughout, #include <sys/disk.h> as needed.

Bump __FreeBSD_version for the sake of the aac disk drivers #ifdefs.

Remove unused disklabel members of softc for aac, amr and mlx, which seem
to originally have been intended for diskerr() use, but which only rotted
and got Copy&Pasted at least two times to many.

Sponsored by:   DARPA & NAI Labs.
2002-09-20 12:52:03 +00:00
Scott Long
eb3025b3ed The aac driver needs 256K of contiguous physical memory in order to
attach.  If it can't get that (highly likely if loaded as a module on
a system that's been up for a while), give a more descriptive error
message.
Also clean up some nearby style nits.

MFC after:	2 days
2002-08-30 05:02:07 +00:00
Robert Watson
d49fa1ca6e In continuation of early fileop credential changes, modify fo_ioctl() to
accept an 'active_cred' argument reflecting the credential of the thread
initiating the ioctl operation.

- Change fo_ioctl() to accept active_cred; change consumers of the
  fo_ioctl() interface to generally pass active_cred from td->td_ucred.
- In fifofs, initialize filetmp.f_cred to ap->a_cred so that the
  invocations of soo_ioctl() are provided access to the calling f_cred.
  Pass ap->a_td->td_ucred as the active_cred, but note that this is
  required because we don't yet distinguish file_cred and active_cred
  in invoking VOP's.
- Update kqueue_ioctl() for its new argument.
- Update pipe_ioctl() for its new argument, pass active_cred rather
  than td_ucred to MAC for authorization.
- Update soo_ioctl() for its new argument.
- Update vn_ioctl() for its new argument, use active_cred rather than
  td->td_ucred to authorize VOP_IOCTL() and the associated VOP_GETATTR().

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs
2002-08-17 02:36:16 +00:00
Scott Long
2f4bfb29bb Fix GET_TRAN_SETTINGS to be more correct.
Don't allow SCSI resets on the 5400S card, it seems to cause problems with
certain backplanes.

Submitted by:	lnb@freebsdsystems.com
MFC after:	3 days
2002-08-10 19:55:00 +00:00
Peter Wemm
7d05a38314 Fix deprecated use of label at end of compound statement 2002-05-24 05:58:13 +00:00
Peter Wemm
70148712be Constify a debug function arg that we pass __func__ to in order to pacify
gcc-3.1's 'const char *__func__;'
2002-05-24 05:57:47 +00:00
Tom Rhodes
d394511de3 More s/file system/filesystem/g 2002-05-16 21:28:32 +00:00
Scott Long
c52bf372f5 Update the PCI table as per Dell's fickleness.
MFC after:	3 days
2002-05-12 04:30:28 +00:00
Scott Long
39ee03c316 bzero out the sync command buffer when sending commands. This was causing
problems when enumerating multiple arrays.

This is an MFC candidate.
2002-05-03 00:07:50 +00:00
Scott Long
1089f082aa Fix a bug where the aacp device would only talk to bus 0 on the
controller.
2002-04-30 22:50:26 +00:00
Scott Long
fe3cb0e1ec Add a CAM interface to the aac driver. This is useful in case you should
ever connect a SCSI Cdrom/Tape/Jukebox/Scanner/Printer/kitty-litter-scooper
to your high-end RAID controller.  The interface to the arrays is still
via the block interface; this merely provides a way to circumvent the
RAID functionality and access the SCSI buses directly.  Note that for
somewhat obvious reasons, hard drives are not exposed to the da driver
through this interface, though you can still talk to them via the pass
driver.  Be the first on your block to low-level format unsuspecting
drives that are part of an array!

To enable this, add the 'aacp' device to your kernel config.

MFC after:	3 days
2002-04-27 01:31:17 +00:00
Scott Long
cbfd045b10 Prepare for a major update to the aac driver:
Update the aac driver with the new crashdump api.
	Protect sync fibs with a mutex.
	Align all DMA buffers on a PAGE_SIZE boundary.

MFC after:	3 days
2002-04-24 05:12:50 +00:00
Scott Long
ce2d4dd7f1 Add the PCI ID for an upcoming variant of a soon-to-be released series of
cards.
2002-04-18 15:47:31 +00:00
Scott Long
fee435e8ac Add support for the Dell 2650
Submitted by:	andrew_bachler@dell.com
2002-04-05 20:00:29 +00:00
John Baldwin
6008862bc2 Change callers of mtx_init() to pass in an appropriate lock type name. In
most cases NULL is passed, but in some cases such as network driver locks
(which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used.

Tested on:	i386, alpha, sparc64
2002-04-04 21:03:38 +00:00
Scott Long
671eafe203 Add support for the PERC3/Di found in the Dell 1650
Submitted by:	mp
2002-04-02 21:49:26 +00:00
Poul-Henning Kamp
67cd130e59 The AAC, TWE and IDA diskdrivers cannot dump until I and msmith
have ripped all the i386 specific formatting code from their
dump routines.  Due to the potential for trashing disks, I did
not want to do this "blind".
2002-03-31 22:29:52 +00:00
Scott Long
0e6020f359 Add ID's for a couple of upcoming cards.
MFC after:	1 day
2002-02-13 07:44:43 +00:00
Scott Long
fe94b852b3 Don't attach to Dell PERC2/QC cards that have a firmware rev of 1.x. This
check is complicated by the fact that the Adaptec 5400S cards claim to use
1.x firmware also.  PERC2/QC 1.x firmware is not compatible with this driver
and will cause a system hang.

MFC after:	3 days
2002-02-06 01:34:09 +00:00
Alfred Perlstein
a4db49537b Replace ffind_* with fget calls.
Make fget MPsafe.

Make fgetvp and fgetsock use the fget subsystem to reduce code bloat.

Push giant down in fpathconf().
2002-01-14 00:13:45 +00:00
Alfred Perlstein
9e209b124a Include sys/_lock.h and sys/_mutex.h to reduce namespace pollution.
Requested by: jhb
2002-01-13 21:37:49 +00:00
Alfred Perlstein
426da3bcfb SMP Lock struct file, filedesc and the global file list.
Seigo Tanimura (tanimura) posted the initial delta.

I've polished it quite a bit reducing the need for locking and
adapting it for KSE.

Locks:

1 mutex in each filedesc
   protects all the fields.
   protects "struct file" initialization, while a struct file
     is being changed from &badfileops -> &pipeops or something
     the filedesc should be locked.

1 mutex in each struct file
   protects the refcount fields.
   doesn't protect anything else.
   the flags used for garbage collection have been moved to
     f_gcflag which was the FILLER short, this doesn't need
     locking because the garbage collection is a single threaded
     container.
  could likely be made to use a pool mutex.

1 sx lock for the global filelist.

struct file *	fhold(struct file *fp);
        /* increments reference count on a file */

struct file *	fhold_locked(struct file *fp);
        /* like fhold but expects file to locked */

struct file *	ffind_hold(struct thread *, int fd);
        /* finds the struct file in thread, adds one reference and
                returns it unlocked */

struct file *	ffind_lock(struct thread *, int fd);
        /* ffind_hold, but returns file locked */

I still have to smp-safe the fget cruft, I'll get to that asap.
2002-01-13 11:58:06 +00:00
Mike Smith
e45bef2aa9 Staticise the aac devclass. 2002-01-09 03:32:40 +00:00
David E. O'Brien
956d569b10 I missed a string concatenation. 2001-12-10 09:34:47 +00:00
David E. O'Brien
6e551fb628 Update to C99, s/__FUNCTION__/__func__/,
also don't use ANSI string concatenation.
2001-12-10 08:09:49 +00:00
Scott Long
8ea9ab6622 MFS: Use correct terminology for RAID 0/1 and 0/5. 2001-12-04 02:39:06 +00:00
Scott Long
1c4c22583c BAH! Missed another change to this file. 2001-12-04 02:26:57 +00:00
Scott Long
a1078af4df Bah, I missed this file on the last commit 2001-12-04 02:24:07 +00:00
Scott Long
c3d15322a1 Use d_thread_t to reduce diffs between current and stable.
Spell ACQUIRE correctly.
2001-12-03 22:55:14 +00:00
Scott Long
b3457b5173 Add functionality and fix bugs so the driver will work with soon-to-be
released management apps.

1.  Implement poll().  This will check for queued aif's so that a
    subsequent ioctl call to retrieve the next aif will not block.
2.  Don't catch signals when sleeping on a fib sent from userland.  This
    causes a race and panic due to the pthread context switcher waking
    up the tsleep at inopportune times.
3.  Fix some whitespace nits.

MFC after:	3 days
2001-12-02 03:47:33 +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
John Baldwin
282873e2c0 - Change the taskqueue locking to protect the necessary parts of a task
while it is on a queue with the queue lock and remove the per-task locks.
- Remove TASK_DESTROY now that it is no longer needed.
- Go back to inlining TASK_INIT now that it is short again.

Inspired by:	dfr
2001-10-26 18:46:48 +00:00
John Baldwin
1de1c550b1 Add locking to taskqueues. There is one mutex per task, one mutex per
queue, and a mutex to protect the global list of taskqueues.  The only
visible change is that a TASK_DESTROY() macro has been added to mirror
the TASK_INIT() macro to destroy a task before it is free'd.

Submitted by:	Andrew Reiter <awr@watson.org>
2001-10-26 06:32:21 +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
Scott Long
5e7e7ec92b Don't use a silly test to define INTR_ENTROPY.
Submitted by:	peter
2001-09-06 08:57:51 +00:00
Scott Long
914da7d0d3 Bring the aac driver *much* closer to style(9).
Reviewed by:	ken
2001-09-05 20:43:02 +00:00
Scott Long
f8185d5456 Sigh. There are actually two ioctls ranges that need to be watched on the
linux side.  This will all be over soon...
2001-09-03 07:50:14 +00:00
Scott Long
61fea38293 Work around a bug where the driver's copy of the disklabel gets corrupted
and causes diskerr() to panic.
2001-09-02 23:16:40 +00:00
Scott Long
3361abb7a7 Restrict the range of linux ioctls we will accept. 2001-09-02 23:15:26 +00:00
Scott Long
6965a4937d Doh! Fix a comma that disappeared along the way.
Pointy-hat by:	peter
2001-08-30 13:09:09 +00:00
Scott Long
36e0bf6e9c Mega update to the aac driver.
1.  Correctly handle commands initiated by the adapter.  These commands
    are defered to a kthread responsible for their processing, then are
    properly returned to the controller.
2.  Add/remove disk devices when notified by the card that a container was
    created/deleted/offline.
3.  Implement crashdump functionality.
4.  Support all ioctls needed for the management CLI to work.  The linux
    version of this app can be found at the Dell or HP website.  A native
    version will be forthcoming.

MFC-after:	4.4-RELEASE
2001-08-29 23:34:05 +00:00
Scott Long
33a375b754 Clarify the description string for one of the StrongARM based cards. 2001-08-17 20:59:49 +00:00
Scott Long
1a393b6188 Adding missing () in a KASSERT format string.
Submitted by:	brandt@fokus.gmd.de
2001-08-07 16:48:28 +00:00
Scott Long
d047ecf50b Make AAC_COMPAT_LINUX optional once again.
Submitted by:	julian
2001-08-06 19:40:47 +00:00
Scott Long
fb0c27d7e2 Put the linux compat ioctl interface on death row. Add FreeBSD
definitions of all of the ioctls, plus round out all ioctl definitions to
match what exists for linux.  Allow ioctls to be called through either the
native or linux interface, though no apps exist (yet) that can take
advantage of native calling.
2001-08-06 04:34:47 +00:00
Scott Long
74e818733c Missed this one in my 80-column sweep. 2001-08-06 03:52:40 +00:00
Scott Long
3d04a9d7e3 Once again throw out the calculation of si_iosize_max and set it to 64K.
Although it can go higher, it is not safe to so do on arrays with many
members.  Compromise by adding a tunable, "hw.aac.iosize_max" that can be
set at boottime.  Also document in the aac(4) manpage.

MFC after:	4 weeks
2001-08-05 07:26:31 +00:00
Scott Long
f6c4dd3f48 Bugfixes. Close a race and logic bug in the timeout handling, don't call the
interrupt handler from the upper half, etc.  This fixes some serious stability
problems that we were seeing on our production server.  These patches have
been tested for almost 6 months and are a highly recommended MFC candidate.

Reviewed by:	gibbs, merry, msmith
MFC after:	4 days
2001-08-05 06:20:13 +00:00
Scott Long
fadfef893f Fix a couple of copyright issues and an 80 column nit that I missed before 2001-08-05 06:15:00 +00:00