Commit Graph

94 Commits

Author SHA1 Message Date
imp
11700d839b Unmark the ASR Compat IOCTLs as BURN_BRIDGES, per scottl@ 2009-05-09 17:47:42 +00:00
ed
4efdef565f Replace all calls to minor() with dev2unit().
After I removed all the unit2minor()/minor2unit() calls from the kernel
yesterday, I realised calling minor() everywhere is quite confusing.
Character devices now only have the ability to store a unit number, not
a minor number. Remove the confusion by using dev2unit() everywhere.

This commit could also be considered as a bug fix. A lot of drivers call
minor(), while they should actually be calling dev2unit(). In -CURRENT
this isn't a problem, but it turns out we never had any problem reports
related to that issue in the past. I suspect not many people connect
more than 256 pieces of the same hardware.

Reviewed by:	kib
2008-09-27 08:51:18 +00:00
scottl
ff584e70fa Prepare for future integration between CAM and newbus. xpt_bus_register
now takes a device_t to be the parent of the bus that is being created.
Most SIMs have been updated with a reasonable argument, but a few exceptions
just pass NULL for now.  This argument isn't used yet and the newbus
integration likely won't be ready until after 7.0-RELEASE.
2007-06-17 05:55:54 +00:00
scottl
7605c12c0f Remove Giant from CAM. Drivers (SIMs) now register a mutex that CAM will
use to synchornize and protect all data objects that are used for that
SIM.  Drivers that are not yet MPSAFE register Giant and operate as
usual.  RIght now, no drivers are MPSAFE, though a few will be changed
in the coming week as this work settles down.

The driver API has changed, so all CAM drivers will need to be recompiled.
The userland API has not changed, so tools like camcontrol do not need to
be recompiled.
2007-04-15 08:49:19 +00:00
piso
6a2ffa86e5 o break newbus api: add a new argument of type driver_filter_t to
bus_setup_intr()

o add an int return code to all fast handlers

o retire INTR_FAST/IH_FAST

For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current

Reviewed by: many
Approved by: re@
2007-02-23 12:19:07 +00:00
mjacob
57868567ea Add MODULE_DEPENDS for cam, pci, mca, eisa and isa where needed.
PR:		106543
MFC after:	3 days
2006-12-11 18:28:31 +00:00
rwatson
10d0d9cf47 Sweep kernel replacing suser(9) calls with priv(9) calls, assigning
specific privilege names to a broad range of privileges.  These may
require some future tweaking.

Sponsored by:           nCircle Network Security, Inc.
Obtained from:          TrustedBSD Project
Discussed on:           arch@
Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri,
                        Alex Lyashkov <umka at sevcity dot net>,
                        Skip Ford <skip dot ford at verizon dot net>,
                        Antoine Brodin <antoine dot brodin at laposte dot net>
2006-11-06 13:42:10 +00:00
mjacob
19b599de4a 2nd and final commit that moves us to CAM_NEW_TRAN_CODE
as the default.

Reviewed by multitudes.
2006-11-02 00:54:38 +00:00
mjacob
7e1db24f98 The first of 3 major steps to move the CAM layer forward to using
the CAM_NEW_TRAN_CODE that has been in the tree for some years now.

This first step consists solely of adding to or correcting
CAM_NEW_TRAN_CODE pieces in the kernel source tree such
that a both a GENERIC (at least on i386) and a LINT build
with CAM_NEW_TRAN_CODE as an option will compile correctly
and run (at least with some the h/w I have).

After a short settle time, the other pieces (making
CAM_NEW_TRAN_CODE the default and updating libcam
and camcontrol) will be brought in.

This will be an incompatible change in that the size of structures
related to XPT_PATH_INQ and XPT_{GET,SET}_TRAN_SETTINGS change
in both size and content. However, basic system operation and
basic system utilities work well enough with this change.

Reviewed by:	freebsd-scsi and specific stakeholders
2006-10-31 05:53:29 +00:00
markm
ee102344bd Remove stale MAINTAINER
OK'd by: scottl
2006-07-09 16:31:53 +00:00
jhb
0f921e0992 Remove various bits of conditional Alpha code and fixup a few comments. 2006-05-12 05:04:46 +00:00
scottl
4b639ea8ed Give the asr softc list global a proper name. 2006-02-12 06:57:41 +00:00
scottl
df4109839c Squash a couple more invalid long casts. 2006-02-05 05:05:27 +00:00
scottl
edc138867c Squash another use of vtophys. Instead of creating separate busdma objects
for doing static memory transfers, start collecting them into a single
object.
2006-02-04 17:56:17 +00:00
scottl
056a4092f0 Add the start of busdma infrastructure to this driver. Convert the
ASR_resetIOPR function to use it.
2006-02-04 08:45:19 +00:00
scottl
9f216f6822 Now that the U32 type is a really 32-bits wide, eliminate a bunch of other
bad assumptions and long values.
2006-02-04 08:20:23 +00:00
scottl
1ee006c612 Give correct definitions to some basic types. 2006-02-04 08:01:49 +00:00
scottl
4fcf1e603c Fix a possible memory leak in asr_attach. 2006-02-04 06:08:19 +00:00
scottl
801f6ef27b Don't allocate an asr_ccb in asr_attach, it hasn't been needed for years. 2006-01-14 16:01:01 +00:00
scottl
13ebfcda1c Replace bogus code with real code. 2006-01-14 15:59:54 +00:00
scottl
55c9e2ca5f Rename driver_t variables. Use device_printf() instead of homerolled printf.
Use the provided softc instead of rolling our own.
2006-01-14 15:51:42 +00:00
ru
798500dfd8 Fix -Wundef from compiling the amd64 LINT. 2005-12-04 10:06:06 +00:00
scottl
6a5362b1bc Only create the rdpti alias if the asr device creation succeeds. 2005-04-29 04:47:11 +00:00
scottl
45160e9067 Make life easier on those trying to use the asr utilities by automatically
creating the /dev/dpti%d entry that the software expects.  This is just
a band-aid until either someone (hopefully) rewrites the utilities, or all
asr/dpt cards in existance get blasted into the sun.
2005-04-01 22:12:53 +00:00
cognet
859631f681 Bring back some of the ioctl junk that was removed in rev 1.59 as a
i386-only kernel option, ASR_COMPAT, and under BURN_BRIDGES.
It is really ugly, but raidutils depends on it.

Discussed with:	scottl
2005-03-17 01:20:49 +00:00
imp
3c710e1d53 Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 19:06:12 +00:00
imp
4b319958e7 Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
marius
7a55a6bbcf - Set the CAM status to CAM_SCSI_STATUS_ERROR rather than CAM_REQ_CMP
in case of a CHECK CONDITION.
- Make this driver return SCSI status information.
- While here, factor out the clearing of the CAM status from every
  element of the switch statement to only once before the switch.

This fixes burning CDs with recent cdrecord 2.01 alpha versions and
burners attached to asr(4) controllers but there could have been
other applications and da(4) etc. also affected.

Reviewed by:	gibbs, scottl
MFC after:	2 weeks
2004-08-02 23:32:23 +00:00
phk
dfd1f7fd50 Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.
2004-06-16 09:47:26 +00:00
phk
9d102d7d5a Add missing <sys/module.h> includes 2004-05-30 20:08:47 +00:00
scottl
028a8161e5 Update the version history in the driver to note everything that has happened
over the last three weeks.
2004-05-05 14:19:43 +00:00
scottl
623bf9e27c Roto-till the ioctl code. Remove all the groping around in the x86 BIOS
segment, remove the groping around in the Option ROM segments, remove the
bogus tests for bcopy vs. copyout.  There really is no reason for a
management app to know these things other than to create l33t info tables
for the user.
2004-05-05 05:29:19 +00:00
scottl
ff0a88340a Convert the asr driver to use the bus_space API. This does not represent
a significant functional change, but it further cleans up the code and
brings it closer to being portable.  Thanks to Don Bowman for helping to
test this.
2004-05-05 03:42:33 +00:00
scottl
7e5c8753a4 Fix a typo from rev 1.56 that somehow escaped my testing. 2004-05-04 03:16:22 +00:00
scottl
da1d089bd2 Remove the static reservation of the asr major number 2004-05-02 03:51:53 +00:00
scottl
eac7eb3288 Remove the defAlignLong and getAlignLong macros. I guess that the original
intent was to make sure that message structs allocated off of the stack were
4-byte aligned.  However, the macros as defined did absolutely nothing.
And since I2O forces you to manually copy messages down to the hardware, there
really is no point of enforced alignment anyways.
2004-05-02 03:33:18 +00:00
scottl
b54dd16b5a Remove the bogus printing of the asr control device major number. Also
rename the control device from rasr%d to asr%d.  This starts us down the
path of divorcing ourselves from a very bogus design in the management
apps.  Since the apps are open source now, they will likely be updated
and fixed before 5.3.
2004-05-02 00:27:54 +00:00
scottl
80f69a6d5c Correctly test *Reply_Ptr in ASR_resetIOP(). Thanks to dhartmei for pointing
this out.
2004-05-01 06:32:01 +00:00
scottl
f43f5b93a9 Re-indent some silly sub-blocks in asr_attach(). 2004-05-01 06:12:58 +00:00
scottl
7c318e6c6c Remove ASR_get_sc() and reference the softc in the dev_t. For some nefarious
reason, the I2O protocol requires knowledge of all I2O devices in the system,
so we can't get rid of the evil linked-list of softc's yet.
2004-05-01 05:56:57 +00:00
scottl
1710764deb Remove the DOMINO and MODE0 device attachments. They never did anything.
Remove a bunch of obfuscating macros.
2004-05-01 05:19:39 +00:00
scottl
bc0854ef24 More whitespace style cleanups, also remove unneeded (void *) casts for bzero(). 2004-05-01 03:06:54 +00:00
scottl
3fed8cc067 Many more style cleanups. Switch complex macros to being inline functions.
Put @includes in a better spot.  Fix many cases of 2 space indents and spaces
between a function name and the parens.  Use KASSERT instead of a home-rolled
ASSERT.  Remove some undeeded caddr casts.
2004-05-01 02:27:06 +00:00
scottl
9837d3b945 Get rid of a bunch of useless macros. STATIC becomes static, INLINE becomes
__inline where appropriate and gets nuked elsewhere, IN/OUT/INOUT go away.
Reformat code affected by this.
2004-05-01 01:25:05 +00:00
njl
9804d2d83f Fix the build. opt_asr.h is gone.
Beer or equivalent to?	njl
2004-04-22 02:22:18 +00:00
scottl
0ec35169f1 Remove more sead code. 2004-04-21 20:58:48 +00:00
scottl
4497606cff Don't indent preprocessor tokens. 2004-04-21 20:56:08 +00:00
scottl
541b648af3 Remove ASR_MEASURE_PERFORMANCE. It hasn't been able to compile in several
years.
2004-04-21 20:14:45 +00:00
scottl
a1ffaf8fa3 Use offsetof() instead of hand-rolling something equivalent. 2004-04-21 20:09:45 +00:00
scottl
151234b98a Remove all of the old __FreeBSD_version code that provided FreeBSD 2.2.x and
3.x shims.
2004-04-21 03:59:52 +00:00