Commit Graph

96 Commits

Author SHA1 Message Date
Brian Somers
86e38263d2 Don't zero 'Info' after setting it up in the ASR_IOCTL_COMPAT case.
MFC after:	2 days
2010-11-25 21:51:43 +00:00
Alexander Motin
83c5d981ac MFp4: Large set of CAM inprovements.
- Unify bus reset/probe sequence. Whenever bus attached at boot or later,
CAM will automatically reset and scan it. It allows to remove duplicate
code from many drivers.
- Any bus, attached before CAM completed it's boot-time initialization,
will equally join to the process, delaying boot if needed.
- New kern.cam.boot_delay loader tunable should help controllers that
are still unable to register their buses in time (such as slow USB/
PCCard/ CardBus devices), by adding one more event to wait on boot.
- To allow synchronization between different CAM levels, concept of
requests priorities was extended. Priorities now split between several
"run levels". Device can be freezed at specified level, allowing higher
priority requests to pass. For example, no payload requests allowed,
until PMP driver enable port. ATA XPT negotiate transfer parameters,
periph driver configure caching and so on.
- Frozen requests are no more counted by request allocation scheduler.
It fixes deadlocks, when frozen low priority payload requests occupying
slots, required by higher levels to manage theit execution.
- Two last changes were holding proper ATA reinitialization and error
recovery implementation. Now it is done: SATA controllers and Port
Multipliers now implement automatic hot-plug and should correctly
recover from timeouts and bus resets.
- Improve SCSI error recovery for devices on buses without automatic sense
reporting, such as ATAPI or USB. For example, it allows CAM to wait, while
CD drive loads disk, instead of immediately return error status.
- Decapitalize diagnostic messages and make them more readable and sensible.
- Teach PMP driver to limit maximum speed on fan-out ports.
- Make boot wait for PMP scan completes, and make rescan more reliable.
- Fix pass driver, to return CCB to user level in case of error.
- Increase number of retries in cd driver, as device may return several UAs.
2010-01-28 08:41:30 +00:00
Warner Losh
ec54a3a337 Unmark the ASR Compat IOCTLs as BURN_BRIDGES, per scottl@ 2009-05-09 17:47:42 +00:00
Ed Schouten
6bfa9a2d66 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
Scott Long
b50569b71d 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
Scott Long
2b83592fdc 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
Paolo Pisati
ef544f6312 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
Matt Jacob
b3d93fd0c9 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
Robert Watson
acd3428b7d 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
Matt Jacob
bd3fd815a7 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
Matt Jacob
fa9ed86506 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
Mark Murray
67ef9ba623 Remove stale MAINTAINER
OK'd by: scottl
2006-07-09 16:31:53 +00:00
John Baldwin
73dbd3da73 Remove various bits of conditional Alpha code and fixup a few comments. 2006-05-12 05:04:46 +00:00
Scott Long
b5a531ae40 Give the asr softc list global a proper name. 2006-02-12 06:57:41 +00:00
Scott Long
5d9299772e Squash a couple more invalid long casts. 2006-02-05 05:05:27 +00:00
Scott Long
1107d45356 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
Scott Long
b0cb1aaf7c 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
Scott Long
b32f2b9a08 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
Scott Long
90acf956d3 Give correct definitions to some basic types. 2006-02-04 08:01:49 +00:00
Scott Long
04ab3022a9 Fix a possible memory leak in asr_attach. 2006-02-04 06:08:19 +00:00
Scott Long
9cbec74dcb Don't allocate an asr_ccb in asr_attach, it hasn't been needed for years. 2006-01-14 16:01:01 +00:00
Scott Long
19e9e8235d Replace bogus code with real code. 2006-01-14 15:59:54 +00:00
Scott Long
8f6ee34112 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
Ruslan Ermilov
3238c6bd33 Fix -Wundef from compiling the amd64 LINT. 2005-12-04 10:06:06 +00:00
Scott Long
a304e92b2b Only create the rdpti alias if the asr device creation succeeds. 2005-04-29 04:47:11 +00:00
Scott Long
e5bd0ae156 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
Olivier Houchard
641a67bed4 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
Warner Losh
53ee71735f Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 19:06:12 +00:00
Warner Losh
098ca2bda9 Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
Marius Strobl
72aca14cfb - 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
Poul-Henning Kamp
89c9c53da0 Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.
2004-06-16 09:47:26 +00:00
Poul-Henning Kamp
fe12f24bb0 Add missing <sys/module.h> includes 2004-05-30 20:08:47 +00:00
Scott Long
c043a33795 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
Scott Long
1e5532d487 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
Scott Long
60c3d7b627 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
Scott Long
01a157ea66 Fix a typo from rev 1.56 that somehow escaped my testing. 2004-05-04 03:16:22 +00:00
Scott Long
eb095afb05 Remove the static reservation of the asr major number 2004-05-02 03:51:53 +00:00
Scott Long
9823f1a2c9 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
Scott Long
c371b99774 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
Scott Long
f5a923258b Correctly test *Reply_Ptr in ASR_resetIOP(). Thanks to dhartmei for pointing
this out.
2004-05-01 06:32:01 +00:00
Scott Long
6021732ae8 Re-indent some silly sub-blocks in asr_attach(). 2004-05-01 06:12:58 +00:00
Scott Long
6f4409dd10 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
Scott Long
68cf1a90b4 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
Scott Long
ec0b2af03f More whitespace style cleanups, also remove unneeded (void *) casts for bzero(). 2004-05-01 03:06:54 +00:00
Scott Long
6f2cb1c2f2 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
Scott Long
cff5a08d74 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
Nate Lawson
28aee9f11e Fix the build. opt_asr.h is gone.
Beer or equivalent to?	njl
2004-04-22 02:22:18 +00:00
Scott Long
f0c8cb0022 Remove more sead code. 2004-04-21 20:58:48 +00:00
Scott Long
ba6d64678f Don't indent preprocessor tokens. 2004-04-21 20:56:08 +00:00
Scott Long
4ada12355d Remove ASR_MEASURE_PERFORMANCE. It hasn't been able to compile in several
years.
2004-04-21 20:14:45 +00:00