History log of /freebsd-10-stable/sys/dev/advansys/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
315813 23-Mar-2017 mav

MFC r311305 (by asomers):
Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)

The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq are
fixed-length strings. AFAICT the only place they're read is in
sbin/camcontrol/camcontrol.c, which assumes they'll be null-terminated.
However, the kernel doesn't null-terminate them. A bunch of copy-pasted code
uses strncpy to write them, and doesn't guarantee null-termination. For at
least 4 drivers (mpr, mps, ciss, and hyperv), the hba_vid field actually
overflows. You can see the result by doing "camcontrol negotiate da0 -v".

This change null-terminates those fields everywhere they're set in the
kernel. It also shortens a few strings to ensure they'll fit within the
16-character field.

PR: 215474
Reported by: Coverity
CID: 1009997 1010000 1010001 1010002 1010003 1010004 1010005
CID: 1331519 1010006 1215097 1010007 1288967 1010008 1306000
CID: 1211924 1010009 1010010 1010011 1010012 1010013 1010014
CID: 1147190 1010017 1010016 1010018 1216435 1010020 1010021
CID: 1010022 1009666 1018185 1010023 1010025 1010026 1010027
CID: 1010028 1010029 1010030 1010031 1010033 1018186 1018187
CID: 1010035 1010036 1010042 1010041 1010040 1010039


/freebsd-10-stable/sys/cam/cam_xpt.c
/freebsd-10-stable/sys/cam/ctl/ctl_frontend_cam_sim.c
/freebsd-10-stable/sys/cam/scsi/scsi_low.c
/freebsd-10-stable/sys/dev/aac/aac_cam.c
/freebsd-10-stable/sys/dev/aacraid/aacraid_cam.c
advansys.c
adwcam.c
/freebsd-10-stable/sys/dev/aha/aha.c
/freebsd-10-stable/sys/dev/ahb/ahb.c
/freebsd-10-stable/sys/dev/ahci/ahci.c
/freebsd-10-stable/sys/dev/ahci/ahciem.c
/freebsd-10-stable/sys/dev/aic/aic.c
/freebsd-10-stable/sys/dev/aic7xxx/aic79xx_osm.c
/freebsd-10-stable/sys/dev/aic7xxx/aic7xxx_osm.c
/freebsd-10-stable/sys/dev/amr/amr_cam.c
/freebsd-10-stable/sys/dev/arcmsr/arcmsr.c
/freebsd-10-stable/sys/dev/ata/ata-all.c
/freebsd-10-stable/sys/dev/buslogic/bt.c
/freebsd-10-stable/sys/dev/ciss/ciss.c
/freebsd-10-stable/sys/dev/dpt/dpt_scsi.c
/freebsd-10-stable/sys/dev/esp/ncr53c9x.c
/freebsd-10-stable/sys/dev/firewire/sbp.c
/freebsd-10-stable/sys/dev/firewire/sbp_targ.c
/freebsd-10-stable/sys/dev/hpt27xx/hpt27xx_osm_bsd.c
/freebsd-10-stable/sys/dev/hptiop/hptiop.c
/freebsd-10-stable/sys/dev/hptmv/entry.c
/freebsd-10-stable/sys/dev/hptnr/hptnr_osm_bsd.c
/freebsd-10-stable/sys/dev/hptrr/hptrr_osm_bsd.c
/freebsd-10-stable/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
/freebsd-10-stable/sys/dev/iir/iir.c
/freebsd-10-stable/sys/dev/isci/isci_controller.c
/freebsd-10-stable/sys/dev/iscsi_initiator/isc_cam.c
/freebsd-10-stable/sys/dev/isp/isp_freebsd.c
/freebsd-10-stable/sys/dev/mfi/mfi_cam.c
/freebsd-10-stable/sys/dev/mly/mly.c
/freebsd-10-stable/sys/dev/mpr/mpr_sas.c
/freebsd-10-stable/sys/dev/mps/mps_sas.c
/freebsd-10-stable/sys/dev/mpt/mpt_cam.c
/freebsd-10-stable/sys/dev/mrsas/mrsas_cam.c
/freebsd-10-stable/sys/dev/mvs/mvs.c
/freebsd-10-stable/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c
/freebsd-10-stable/sys/dev/ppbus/vpo.c
/freebsd-10-stable/sys/dev/siis/siis.c
/freebsd-10-stable/sys/dev/sym/sym_hipd.c
/freebsd-10-stable/sys/dev/trm/trm.c
/freebsd-10-stable/sys/dev/twa/tw_osl_cam.c
/freebsd-10-stable/sys/dev/tws/tws_cam.c
/freebsd-10-stable/sys/dev/virtio/scsi/virtio_scsi.c
/freebsd-10-stable/sys/powerpc/ps3/ps3cdrom.c
/freebsd-10-stable/sys/powerpc/pseries/phyp_vscsi.c
281826 21-Apr-2015 mav

MFC r280347: Remove MAXBSIZE use from drivers where it has nothing to do.

In some cases limits are just not needed, in others -- DFLTPHYS is the
right constant to use instead.

275982 21-Dec-2014 smh

MFC r274819:
Prevent overflow issues in timeout processing

MFC r274852:
Fix build with asr driver

Sponsored by: Multiplay

259977 28-Dec-2013 dim

MFC r259825:

Remove unused static function adwccbstatus() from adw(4).

Reviewed by: gibbs

256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


254263 12-Aug-2013 scottl

Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCI
command register. The lazy BAR allocation code in FreeBSD sometimes
disables this bit when it detects a range conflict, and will re-enable
it on demand when a driver allocates the BAR. Thus, the bit is no longer
a reliable indication of capability, and should not be checked. This
results in the elimination of a lot of code from drivers, and also gives
the opportunity to simplify a lot of drivers to use a helper API to set
the busmaster enable bit.

This changes fixes some recent reports of disk controllers and their
associated drives/enclosures disappearing during boot.

Submitted by: jhb
Reviewed by: jfv, marius, achadd, achim
MFC after: 1 day


246713 12-Feb-2013 kib

Reform the busdma API so that new types may be added without modifying
every architecture's busdma_machdep.c. It is done by unifying the
bus_dmamap_load_buffer() routines so that they may be called from MI
code. The MD busdma is then given a chance to do any final processing
in the complete() callback.

The cam changes unify the bus_dmamap_load* handling in cam drivers.

The arm and mips implementations are updated to track virtual
addresses for sync(). Previously this was done in a type specific
way. Now it is done in a generic way by recording the list of
virtuals in the map.

Submitted by: jeff (sponsored by EMC/Isilon)
Reviewed by: kan (previous version), scottl,
mjacob (isp(4), no objections for target mode changes)
Discussed with: ian (arm changes)
Tested by: marius (sparc64), mips (jmallet), isci(4) on x86 (jharris),
amd64 (Fabian Keil <freebsd-listen@fabiankeil.de>)


241588 15-Oct-2012 jhb

Add locking to the adw(4) driver and mark it MPSAFE.
- Use device_printf() and device_get_nameunit() instead of adw_name().
- Remove use of explicit bus space handles and tags.
- Use pci_enable_busmaster() rather than frobbing the PCI command register
directly.
- Use the softc provided by new-bus rather than allocating a new one.

Tested by: no one


241492 12-Oct-2012 jhb

Add locking to adv(4) driver and mark it MPSAFE.
- Disable the support for the second channel on twin-channel EISA cards as
the current incarnation can't possibly work correctly (it hasn't worked
since switching to new-bus where new-bus allocates the softc). If anyone
bothers to test this again it can be fixed properly and brought back.
- Use device_printf() and device_get_nameunit() instead of adv_name().
- Remove use of explicit bus space handles and tags.
- Use PCI bus accessors and helper routines rather than accessing
config registers directly.
- Handle failures from adv_attach().

Tested by: no one (hope it works)


232883 12-Mar-2012 scottl

Final pass at having devices use their bus parent for dma tags. The
remaining drivers that haven't been converted have various problems or
complexities that will be dealt with later. This list includes:

hptrr, hptmv, hpt27xx - device aggregation across multiple parents
drm - want to talk to the maintainer first
tsec, sec - Openfirmware devices, not sure if changes are warranted
fatm - Done except for unused testing code
usb - want to talk to the maintainer first
ce, cp, ctau, cx - Significant driver changes needed to convey parent info

There are also devices tucked into architecture subtrees that I'll leave
for the respective maintainers to deal with.


232882 12-Mar-2012 jmallett

Remove comments about creating DMA tags as children of the DMA tags of their
parent bus where the code has now been modified to do so.

Reviewed by: scottl


232854 12-Mar-2012 scottl

Convert a number of drivers to obtaining their parent DMA tag from their
PCI device attachment.


218909 21-Feb-2011 brucec

Fix typos - remove duplicate "the".

PR: bin/154928
Submitted by: Eitan Adler <lists at eitanadler.com>
MFC after: 3 days


195534 10-Jul-2009 scottl

Separate the parallel scsi knowledge out of the core of the XPT, and
modularize it so that new transports can be created.

Add a transport for SATA

Add a periph+protocol layer for ATA

Add a driver for AHCI-compliant hardware.

Add a maxio field to CAM so that drivers can advertise their max
I/O capability. Modify various drivers so that they are insulated
from the value of MAXPHYS.

The new ATA/SATA code supports AHCI-compliant hardware, and will override
the classic ATA driver if it is loaded as a module at boot time or compiled
into the kernel. The stack now support NCQ (tagged queueing) for increased
performance on modern SATA drives. It also supports port multipliers.

ATA drives are accessed via 'ada' device nodes. ATAPI drives are
accessed via 'cd' device nodes. They can all be enumerated and manipulated
via camcontrol, just like SCSI drives. SCSI commands are not translated to
their ATA equivalents; ATA native commands are used throughout the entire
stack, including camcontrol. See the camcontrol manpage for further
details. Testing this code may require that you update your fstab, and
possibly modify your BIOS to enable AHCI functionality, if available.

This code is very experimental at the moment. The userland ABI/API has
changed, so applications will need to be recompiled. It may change
further in the near future. The 'ada' device name may also change as
more infrastructure is completed in this project. The goal is to
eventually put all CAM busses and devices until newbus, allowing for
interesting topology and management options.

Few functional changes will be seen with existing SCSI/SAS/FC drivers,
though the userland ABI has still changed. In the future, transports
specific modules for SAS and FC may appear in order to better support
the topologies and capabilities of these technologies.

The modularization of CAM and the addition of the ATA/SATA modules is
meant to break CAM out of the mold of being specific to SCSI, letting it
grow to be a framework for arbitrary transports and protocols. It also
allows drivers to be written to support discrete hardware without
jeopardizing the stability of non-related hardware. While only an AHCI
driver is provided now, a Silicon Image driver is also in the works.
Drivers for ICH1-4, ICH5-6, PIIX, classic IDE, and any other hardware
is possible and encouraged. Help with new transports is also encouraged.

Submitted by: scottl, mav
Approved by: re


170872 17-Jun-2007 scottl

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.


168752 15-Apr-2007 scottl

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.


166901 23-Feb-2007 piso

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@


165102 11-Dec-2006 mjacob

Add MODULE_DEPENDS for cam, pci, mca, eisa and isa where needed.

PR: 106543
MFC after: 3 days


163896 02-Nov-2006 mjacob

2nd and final commit that moves us to CAM_NEW_TRAN_CODE
as the default.

Reviewed by multitudes.


163816 31-Oct-2006 mjacob

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


158177 30-Apr-2006 scottl

Remove some header polution.


155319 04-Feb-2006 imp

Type of overrun_buf doesn't matter to this code, but does to gcc.
Make it a void *.


153072 04-Dec-2005 ru

Fix -Wundef.


147970 13-Jul-2005 jhb

Don't try to probe ISA PnP devices for now until this driver can grow a
list of known-valid PnP IDs.

Discussed with: imp
MFC after: 3 days


146734 29-May-2005 nyan

Remove bus_{mem,p}io.h and related code for a micro-optimization on i386
and amd64. The optimization is a trivial on recent machines.

Reviewed by: -arch (imp, marcel, dfr)


143164 05-Mar-2005 imp

Use BUS_PROBE_DEFAULT for pci probe return value


142160 21-Feb-2005 scottl

Check for BIOS version 3.0 as well as 3.1.

Submitted by: Coverity Prevent analysis tool


141854 14-Feb-2005 obrien

Fix a missing /*-


139749 06-Jan-2005 imp

Start each of the license/copyright comments with /*-, minor shuffle of lines


138502 06-Dec-2004 rsm

Properly release allocated resources if adw(4) device fails to fully attach,
eg. if the firmware load fails. Shortish MFC timeout so this can be merged
before the 4.11 freeze.

PR: kern/34306
Submitted by: gibbs
Approved by: gibbs, imp (mentor)
MFC after: 5 days


129879 30-May-2004 phk

Add missing <sys/module.h> includes


127135 17-Mar-2004 njl

Convert callers to the new bus_alloc_resource_any(9) API.

Submitted by: Mark Santcroos <marks@ripe.net>
Reviewed by: imp, dfr, bde


126822 10-Mar-2004 phk

Make the extern for adv_mcode match the reality: it's u_int8_t, but
probably unendiansafely used as u_int16_t.


119690 02-Sep-2003 jhb

Use PCIR_BAR(x) instead of PCIR_MAPS.

Glanced over by: imp, gibbs
Tested by: i386 LINT


119418 24-Aug-2003 obrien

Use __FBSDID().
Also some minor style cleanups.


119277 22-Aug-2003 imp

Prefer new location of pci include files (which have only been in the
tree for two or more years now), except in a few places where there's
code to be compatible with older versions of FreeBSD.


117126 01-Jul-2003 scottl

Mega busdma API commit.

Add two new arguments to bus_dma_tag_create(): lockfunc and lockfuncarg.
Lockfunc allows a driver to provide a function for managing its locking
semantics while using busdma. At the moment, this is used for the
asynchronous busdma_swi and callback mechanism. Two lockfunc implementations
are provided: busdma_lock_mutex() performs standard mutex operations on the
mutex that is specified from lockfuncarg. dftl_lock() is a panic
implementation and is defaulted to when NULL, NULL are passed to
bus_dma_tag_create(). The only time that NULL, NULL should ever be used is
when the driver ensures that bus_dmamap_load() will not be deferred.
Drivers that do not provide their own locking can pass
busdma_lock_mutex,&Giant args in order to preserve the former behaviour.

sparc64 and powerpc do not provide real busdma_swi functions, so this is
largely a noop on those platforms. The busdma_swi on is64 is not properly
locked yet, so warnings will be emitted on this platform when busdma
callback deferrals happen.

If anyone gets panics or warnings from dflt_lock() being called, please
let me know right away.

Reviewed by: tmm, gibbs


116351 14-Jun-2003 njl

Merge common XPT_CALC_GEOMETRY functions into a single convenience function.
Devices below may experience a change in geometry.

* Due to a bug, aic(4) never used extended geometry. Changes all drives
>1G to now use extended translation.
* sbp(4) drives exactly 1 GB in size now no longer use extended geometry.
* umass(4) drives exactly 1 GB in size now no longer use extended geometry.

For all other controllers in this commit, this should be a no-op.

Looked over by: scottl


115343 27-May-2003 scottl

Bring back bus_dmasync_op_t. It is now a typedef to an int, though the
BUS_DMASYNC_ definitions remain as before. The does not change the ABI,
and reverts the API to be a bit more compatible and flexible. This has
survived a full 'make universe'.

Approved by: re (bmah)


113350 10-Apr-2003 mux

I deserve a big pointy hat for having missed all those references
to bus_dmasync_op_t in my last commit.


112782 29-Mar-2003 mdodd

Clean up argument comments for bus_dma_tag_create() calls.


111409 24-Feb-2003 obrien

Wrap the static endian functions to shutup GCC.


111342 23-Feb-2003 obrien

Add adv_adj_endian_qdone_info() & adv_adj_scsiq_endian()
so this at least compiles on big-endian machines.


110232 02-Feb-2003 alfred

Consolidate MIN/MAX macros into one place (param.h).

Submitted by: Hiten Pandya <hiten@unixdaemons.com>


109536 19-Jan-2003 mike

Change BUS_SPACE_UNRESTRICTED (~0ul) to plain ~0 when used in the
'int nsegments' argument to bus_dma_tag_create(). ~0ul does not fit in
an int on machines with 64 bit longs.

Noticed by: alpha tinderbox


104707 09-Oct-2002 peter

Change BUS_SPACE_UNRESTRICTED (~0ul) to plain ~0 when used in the
'int nsegments' argument to bus_dma_tag_create(). ~0ul does not fit in
an int.


104094 28-Sep-2002 phk

Be consistent about "static" functions: if the function is marked
static in its prototype, mark it static at the definition too.

Inspired by: FlexeLint warning #512


76309 06-May-2001 nyan

Restore I/O port resources to the condition before adv_isa_probe() is
called.

Submitted by: yokota


76307 06-May-2001 nyan

Use correct resource id for bus_release_resource().


73280 01-Mar-2001 markm

Turn on interrupt-entropy harvesting for all/any mass storage devices
I could find. I have no doubt missed a couple.

Interrupt entropy harvesting is still conditional on the
kern.random.sys.harvest_interrupt sysctl.


72147 08-Feb-2001 jhb

- Check if the ccb_infos in the softc is NULL before trying to free it in
adv_free() as the ISA probe routine doesn't malloc() ccb_infos but does
call adv_free().
- Release the ISA-only overrun DMA tags, bufs, and maps if the probe fails.

Tested by: rwatson


67899 29-Oct-2000 phk

Remove unneeded <stddef.h> #includes.


67888 29-Oct-2000 dwmalone

Add the use of M_ZERO to some malloc calls.

Submitted by: josh@zipperup.org
Submitted by: Robert Drehmel <robd@gmx.net>
Approved by: gibbs


67708 27-Oct-2000 phk

Convert all users of fldoff() to offsetof(). fldoff() is bad
because it only takes a struct tag which makes it impossible to
use unions, typedefs etc.

Define __offsetof() in <machine/ansi.h>

Define offsetof() in terms of __offsetof() in <stddef.h> and <sys/types.h>

Remove myriad of local offsetof() definitions.

Remove includes of <stddef.h> in kernel code.

NB: Kernelcode should *never* include from /usr/include !

Make <sys/queue.h> include <machine/ansi.h> to avoid polluting the API.

Deprecate <struct.h> with a warning. The warning turns into an error on
01-12-2000 and the file gets removed entirely on 01-01-2001.

Paritials reviews by: various.
Significant brucifications by: bde


67164 15-Oct-2000 phk

Remove unneeded #include <machine/clock.h>


61686 14-Jun-2000 alex

Fix typo (accessable --> accessible).

PR: 18588
Submitted by: Anatoly Vorobey <mellon@pobox.com>
Reviewed by: asmodai


61484 10-Jun-2000 peter

Unused include: #include "adw.h"


61034 28-May-2000 peter

Use the correct register names, not the FreeBSD 2.2 compatability ones.


60938 26-May-2000 jake

Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by: msmith and others


60833 23-May-2000 jake

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


60818 23-May-2000 nyan

Fixed return value of adv_attach function.

Submitted by: Oleg Sharoiko <os@rsu.ru>


59534 23-Apr-2000 phk

Hide annoying message under boot-verbose.
Fix Typo.

Approved by: nyan
Also: PR-18172


59368 18-Apr-2000 phk

Remove unneeded <sys/buf.h> includes.

Due to some interesting cpp tricks in lockmgr, the LINT kernel shrinks
by 924 bytes.


59171 12-Apr-2000 nyan

- Release allocated resources on error.
Reported by YAMAMOTO Shigeru <shigeru@iij.ad.jp>
- Clean up some code.
- Set the value of rid variable to PCI_BASEADR0(== 0x10) (adv_pci.c).


59082 07-Apr-2000 nyan

Newbusify adv driver.

Reviewed by: imp


57679 02-Mar-2000 gibbs

adv_pci.c:
adw_pci.c:
Update comments describing supported chips/cards.

adwcam.c:
adwlib.c:
adwlib.h:
Handle more error return codes from the firmware.

Break out the bus reset code into its own function.

Usa a constant for the bus reset hold delay.

Fix an interrupt race problem in adw_idle_cmd_send by
incorporating the poll loop for command completion.

Approved by: jkh@FreeBSDorg


56990 04-Feb-2000 gibbs

Fix indentation.

Overlooked by: n_himba@FreeBSD.org but not bde@FreeBSD.org


56989 04-Feb-2000 n_hibma

Unbreak LINT (missing curly brace).

Broken by: gibbs


56979 03-Feb-2000 gibbs

Add support for the AdvanSys ASC38C0800 Ultra2 chipset. Preliminary
support is also included for the ASC38C1600 Ultra160 chipset, but
as firmware is not yet available for this chip, it is disabled.

Approved by: jkh@FreeBSD.org


56926 01-Feb-2000 gibbs

Remove a spurious printf left in from debugging.

PR: 16642


56871 29-Jan-2000 peter

Remove unneeded #include "eisa.h" and #if NEISA > 0


56178 17-Jan-2000 nyan

Remove unnecessary includes.


55953 14-Jan-2000 peter

Pre 4.0 tidy up.

Collect together the components of several drivers and export eisa from
the i386-only area (It's not, it's on some alphas too). The code hasn't
been updated to work on the Alpha yet, but that can come later.

Repository copies were done a while ago.
Moving these now keeps them in consistant place across the 4.x series
as the newbusification progresses.

Submitted by: mdodd


55945 14-Jan-2000 gibbs

adv_pci.c:
Update list of supported products.
Adjust probe message to include the ASC3030.

advansys.c:
Fix a long standing bug in the error recovery strategy. In order
to keep recovery simple, we freeze the SIMQ, stopping the XPT from
submitting new requests. Unfortunately, we also will freeze the
SIMQ if bus_dmamap_load blocks or we run out of controller resources.
On cards with limited resources it was possible to freeze the
SIM a second time and never unfreeze it. Now we more carefully
track our exception state so we never freeze the SIMQ more than
once.

Don't rely on pointers fitting in a 32bit field stored in the
per-transaction data structures on the card. Use an index to
an array of transaction mapping structures instead. This should
allow this driver to work on the Alpha.

Deal with the ASC3030 which is almost idistinguishable from the
ASC3050. Unfortunately the ASC3030 does not work at Ultra speeds,
so if we can't find an eeprom, we must assume that ultra is disabled.
The SIIG cards using the 3030 do not have eeproms. As a side effect,
we now honor the ultra disable bit in the eeprom if it is present.

Don't bother attempting to write corrected eeprom data back to the
eeprom. We can function just fine if the data is corrupted and
I'd rather not risk messing up the user's eeprom.

Modify the interrupt handler to catch latched external bus rests.

Dynamically determine the maximum number of S/G elements we can
map at a single time. The nature of the firmware interface for
these cards makes this value dependent on the number of "queues"
the card can support.

advlib.c:
advlib.h:
advmcode.c:
advmcode.h:
Synchronize with the latest firmware image released in the
Linux Advansys driver.


51680 26-Sep-1999 eivind

Move the declaration of panic() from sys/systm.h to sys/param.h.
Rationale: Wider access, so we can add assertions to header files.
panicstr is still in sys/systm.h

Suggested by: phk
Discussed with: peter


51164 11-Sep-1999 gibbs

Fix a compile warning.


50477 28-Aug-1999 peter

$Id$ -> $FreeBSD$


49860 16-Aug-1999 gibbs

Properly set the alignment argument to bus_dma_tag_create(). If we
don't care about the alignment, set it to 1, meaning single byte alignment.


49360 01-Aug-1999 mdodd

Move the specification of EDGE/LEVEL triggered interrupts to
eisa_add_intr() which now takes an additional arguement (one of
EISA_TRIGGER_LEVEL or EISA_TRIGGER_EDGE).

The flag RR_SHAREABLE has no effect when passed to
bus_alloc_resource(dev, SYS_RES_IRQ, ...) in an EISA device context as
the eisa_alloc_resource() call (bus_alloc_resource method) now deals
with this flag directly, depending on the device ivars.

This change does nothing more than move all the 'shared = inb(foo + iobsse)'
nonesense to the device probe methods rather than the device attach.

Also, print out 'edge' or 'level' in the IRQ announcement message.

Reviewed by: dfr


48528 03-Jul-1999 peter

Eliminate a bunch of #include "pci.h" and #if NPCI > 0 around entire
files. config will leave the whole file out if configured to do so.


46813 09-May-1999 peter

Simplify the COMPAT_PCI_DRIVER/DATA_SET hack. We can add:
#define COMPAT_PCI_DRIVER(name,data) DATA_SET(pcidevice_set,data)
.. to 2.2.x and 3.x if people think it's worth it. Driver writers can do
this if it's not defined. (The reason for this is that I'm trying to
progressively eliminate use of linker_sets where it hurts modularity and
runtime load capability, and these DATA_SET's keep getting in the way.)


46743 08-May-1999 dfr

Move the declaration of the interrupt type from the driver structure
to the BUS_SETUP_INTR call.


46720 08-May-1999 peter

Use haveseen_ioport() which is now connected up to the resource manager.


46581 06-May-1999 ken

Add a number of interrelated CAM feature enhancements and bug fixes.

NOTE: These changes will require recompilation of any userland
applications, like cdrecord, xmcd, etc., that use the CAM passthrough
interface. A make world is recommended.

camcontrol.[c8]:
- We now support two new commands, "tags" and "negotiate".

- The tags commands allows users to view the number of tagged
openings for a device as well as a number of other related
parameters, and it allows users to set tagged openings for
a device.

- The negotiate command allows users to enable and disable
disconnection and tagged queueing, set sync rates, offsets
and bus width. Note that not all of those features are
available for all controllers. Only the adv, ahc, and ncr
drivers fully support all of the features at this point.
Some cards do not allow the setting of sync rates, offsets and
the like, and some of the drivers don't have any facilities to
do so. Some drivers, like the adw driver, only support enabling
or disabling sync negotiation, but do not support setting sync
rates.

- new description in the camcontrol man page of how to format a disk
- cleanup of the camcontrol inquiry command
- add support in the 'devlist' command for skipping unconfigured devices if
-v was not specified on the command line.
- make use of the new base_transfer_speed in the path inquiry CCB.
- fix CCB bzero cases

cam_xpt.c, cam_sim.[ch], cam_ccb.h:

- new flags on many CCB function codes to designate whether they're
non-immediate, use a user-supplied CCB, and can only be passed from
userland programs via the xpt device. Use these flags in the transport
layer and pass driver to categorize CCBs.

- new flag in the transport layer device matching code for device nodes
that indicates whether a device is unconfigured

- bump the CAM version from 0x10 to 0x11

- Change the CAM ioctls to use the version as their group code, so we can
force users to recompile code even when the CCB size doesn't change.

- add + fill in a new value in the path inquiry CCB, base_transfer_speed.
Remove a corresponding field from the cam_sim structure, and add code to
every SIM to set this field to the proper value.

- Fix the set transfer settings code in the transport layer.

scsi_cd.c:

- make some variables volatile instead of just casting them in various
places
- fix a race condition in the changer code
- attach unless we get a "logical unit not supported" error. This should
fix all of the cases where people have devices that return weird errors
when they don't have media in the drive.

scsi_da.c:

- attach unless we get a "logical unit not supported" error

scsi_pass.c:

- for immediate CCBs, just malloc a CCB to send the user request in. This
gets rid of the 'held' count problem in camcontrol tags.

scsi_pass.h:

- change the CAM ioctls to use the CAM version as their group code.

adv driver:

- Allow changing the sync rate and offset separately.

adw driver

- Allow changing the sync rate and offset separately.

aha driver:

- Don't return CAM_REQ_CMP for SET_TRAN_SETTINGS CCBs.

ahc driver:

- Allow setting offset and sync rate separately

bt driver:

- Don't return CAM_REQ_CMP for SET_TRAN_SETTINGS CCBs.

NCR driver:

- Fix the ultra/ultra 2 negotiation bug
- allow setting both the sync rate and offset separately

Other HBA drivers:
- Put code in to set the base_transfer_speed field for
XPT_GET_TRAN_SETTINGS CCBs.

Reviewed by: gibbs, mjacob (isp), imp (aha)


46024 24-Apr-1999 peter

Use COMPAT_PCI_DRIVER() for registration if it exists. This shouldn't
hurt the driver portability to 3.x too much for where drivers are shared.


45968 23-Apr-1999 gibbs

staticize.


45964 23-Apr-1999 gibbs

Kill a compiler warning.


45846 19-Apr-1999 gibbs

Handle the case when auto sense retrieval fails.
Give automatic request sense operations a 5 second timeout.


45791 18-Apr-1999 peter

Implement an EISA new-bus framework. The old driver probe mechanism
had a quirk that made a shim rather hard to implement properly and it was
just easier to convert the drivers in one go. The changes to the
buslogic driver go beyond just this - the whole driver was new-bus'ed
including pci and isa. I have only tested the EISA part of this so far.

Submitted by: Doug Rabson <dfr@nlsystems.com>


45577 11-Apr-1999 eivind

Staticize.


45575 11-Apr-1999 eivind

Staticize.


45443 07-Apr-1999 gibbs

Beef up the error handling routine to handle more errors.

Compensate for a bug in the AdvanSys firmware where a valid queue
full condition can be reported via a different error code.


42410 08-Jan-1999 bde

Unspammed includes in <machine/cpufunc.h> in the !SMP case. Partially
unspammed them in the SMP case.


42012 22-Dec-1998 gibbs

Staticize the overrun buffer so that they are not shared between
cards of different bus types as each bus type may have a different
bus mapping.

Submitted by: Eivind Eklund <eivind@yes.no>


42011 22-Dec-1998 gibbs

Return NULL on resource shortage instead of blindly continuing.

Obtained from: Eivind Eklund <eivind@yes.no>


41771 14-Dec-1998 dillon

probe function changed from returning char * to const char *.


41591 07-Dec-1998 archie

The "easy" fixes for compiling the kernel -Wunused: remove unreferenced static
and local variables, goto labels, and functions declared but not defined.


41514 04-Dec-1998 archie

Examine all occurrences of sprintf(), strcat(), and str[n]cpy()
for possible buffer overflow problems. Replaced most sprintf()'s
with snprintf(); for others cases, added terminating NUL bytes where
appropriate, replaced constants like "16" with sizeof(), etc.

These changes include several bug fixes, but most changes are for
maintainability's sake. Any instance where it wasn't "immediately
obvious" that a buffer overflow could not occur was made safer.

Reviewed by: Bruce Evans <bde@zeta.org.au>
Reviewed by: Matthew Dillon <dillon@apollo.backplane.com>
Reviewed by: Mike Spengler <mks@networkcs.com>


41048 10-Nov-1998 gibbs

Fix probes when a port address is specified.


40733 29-Oct-1998 gibbs

Correct the reporting of the queue full condition so that the XPT layer
can properly throttle tags.

Add diagnostic printfs for firmware result codes that we encounter but
don't know anything about.


40420 15-Oct-1998 gibbs

-Wunused cleanup.

Fixed bug in advansys.c where we did not properly clean up ccb_info data
structures in softc teardown.

Submitted by: Poul-Henning Kamp <phk@freebsd.org>


40265 12-Oct-1998 imp

Fix breakage introduced by last patch. bde has added CC_QUIET flag to
hasseen_isadev so this will be less noisy when conflicts do exist.
Also eliminate redundant warnings about conflicts.

Requested by: bde
Reviewed by: gibbs


40160 10-Oct-1998 imp

Fix conficts in probe:
o For bt and aha only probe the one I/O range if a specific I/O is specified
in the config file.
o Don't even try to probe I/O ranges that have been seen already.
o If we conflict with an IRQ or DRQ, then fail the probe.

Requested by: bde, gibbs
Approved by: jkh


40133 09-Oct-1998 gibbs

Only pull 16 bits of residual information from completing queues. This
is a work-around from an LRAM access bug on the 940UA. In a future
microcode revision, the high 16bits of residual information will be moved
to a safe location and we'll return to 32bit residuals. Since we only
allow 64KB I/O, 16bits is enough.


40027 07-Oct-1998 gibbs

Don't set the active flag on a transaction resource until it has been
queued.

Perform dma segment setup outside of splcam protection as this can take
some time and the protection is not necessary.

Inline a function.

Clean up some whitespace.


40024 07-Oct-1998 gibbs

Add support for the ASC3550 AdvanSys SCSI Host Controller (aka 940UW).


39505 20-Sep-1998 gibbs

Correct compilation with option DIAGNOSTIC set.

Upgrade to the latest firmware.


39218 15-Sep-1998 gibbs

EISA bus attachment for the AdvanSys driver.


39217 15-Sep-1998 gibbs

Advance Systems SCSI Host Adapter driver for CAM. Currently only support
the 8bit SCSI AdvanSys products.


22975 22-Feb-1997 peter

Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not
ready for it yet.


21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


19426 05-Nov-1996 gibbs

A little 80 column cleanup.


18782 07-Oct-1996 gibbs

This commit was generated by cvs2svn to compensate for changes in r18781,
which included commits to RCS files with non-trunk default branches.


18781 07-Oct-1996 gibbs

Advanced Systems Inc. SCSI Controller driver and ISA/VL front end.

I have only tested the ABP5140 card and only with a single CDROM drive
but it seems to work fine. This driver relies on features found only in
the SCSI branch so will not work in -current until those changes
are brought in. It also doesn't have any error handling code *yet*.
The goal is to use this driver as the development platform for the new
generic SCSI layer error recovery/handling code.

PCI and EISA front ends will show up as soon as I get my hands on
the cards. There are also a few issues in the driver that I need
to clear up with AdvanSys before I can suggest sticking one of
these cards in your server. 8-)

Thanks to AdvanSys for releasing this code under a suitable copyright.

Obtained from: Ported from the Linux driver writen by
bobf@advansys.com (Bob Frey).