Commit Graph

332 Commits

Author SHA1 Message Date
mjacob
a9c2af8be3 Add in new async mbox defines for 2200- point to point stuff.
Add in definitions for the extended initialization control block
(2200 only again).

Approved: jkh@freebsd.org
2000-02-11 19:35:42 +00:00
mjacob
a5b041f3d2 Add in 12160 (Ultra3) NVRAM definitions.
Approved: jkh@freebsd.org
2000-02-11 19:34:33 +00:00
mjacob
cb72bcab1b Add in 12160 (Ultra3) firmware. Gawd, this file is bulky.
Approved: jkh@freebsd.org
2000-02-11 19:32:51 +00:00
mjacob
9081880850 Restructure nvram reading routine to split out to separate functions
for 1020/1X80/12160/2X00- for readability. Add in 12160 (Ultra3)
support- but not with PPR just yet.  Fix and clarify fetching of
return parameter for getting firmware rev which for the 2200 contains
the connection topology (Private Loop (NL-port), N-port, FL-port,
F-port). Synthesize the connection topology for the 2100 which can
only be Private Loop or FL-port. Handle a couple of new async
mailbox commands which signify connection in Point-to-Point mode
(N-port or F-port) or indicate various toe stubbing getting to same.

Approved: jkh@freebsd.org
2000-02-11 19:31:32 +00:00
mjacob
7d5f5fd6a6 Add 12160 (Ultra3) defines. Add config option flag for forcing point-to-point
instead of FC-AL (2200 only).

Approved: jkh@freebsd.org
2000-02-11 19:25:01 +00:00
mjacob
a95eb8d83c There seems to be some problems, particularly on alpha, with
FAST POSTING enabled for parallel SCSI. Be sure about things
and disable it for now.
2000-01-21 20:54:22 +00:00
mjacob
6f78cf499f Remove compile warning not seen when compiling with target mode enabled. 2000-01-15 07:06:44 +00:00
mjacob
af62fb2de8 Redo FC target mode dma routine to try and generate an extra CTIO
in the not so odd case of Moving Data *AND* Sending Status in last CTIO *AND*
status is a CHECK CONDITION *AND* we have Sense Data to send.
2000-01-15 01:54:36 +00:00
mjacob
f12357ba49 clean up for SBus Ultra (yes, we do not do that here yet) 2000-01-15 01:52:01 +00:00
mjacob
e4f656172a a whale of a lot of target mode cleanup 2000-01-15 01:50:48 +00:00
mjacob
14386bc152 cleanup- it was not MI code as it should have been 2000-01-15 01:49:09 +00:00
mjacob
aa702e544c cleanup 2000-01-15 01:48:24 +00:00
mjacob
d38e10d63f include public target mode functions 2000-01-15 01:47:10 +00:00
mjacob
915d501bd7 public target mode stuff 2000-01-15 01:46:37 +00:00
mjacob
b483a178f2 tighten up printout 2000-01-15 01:43:19 +00:00
mjacob
c563701110 add MAINTAINER file for clarity 2000-01-13 18:45:14 +00:00
mjacob
d706677e98 change debug printout lefvels for a couple of places 2000-01-09 21:47:39 +00:00
mjacob
59326b98ed oop, use PRINTF not printf in MI code 2000-01-04 05:17:48 +00:00
mjacob
e3ab3c247b Clean up some debug printing. Find the correct lun when SCCLUN is
defined. If we complete with a check condition but no sense data,
say we had an AUTOSENSE failure.
2000-01-04 03:45:49 +00:00
mjacob
981a7cc5f7 Make Fibre Channel cards correctly note the presence/absence
of ARQ data and punt the dealing with its presence/absence
to the platform layers.
2000-01-04 03:44:21 +00:00
mjacob
2fabb47dbd set default target mode debug to 0 2000-01-04 03:43:03 +00:00
mjacob
6c20e77592 add clarifying tag define for FC 2000-01-04 03:42:19 +00:00
mjacob
8928ecdac1 Add in an isp_tdebug environment variable. Clean up some debugging
printouts for clarity.
2000-01-04 03:41:40 +00:00
mjacob
67d3623f49 These are platform independent functions for target mode support.
This is just a first pass at this and is likely to change a bit
over the next month.
2000-01-04 00:00:08 +00:00
mjacob
54fb57c62d These are platform independent definitions for target mode support-
code gratefully borrowed from Patrick Stirling who did a lot of the
grunt work on this years ago. There are also some beginnings of
swizzle macros in case we go to a big endian machine. This is just
a first pass at this and is likely to change a bit over the next
2000-01-03 23:58:41 +00:00
mjacob
b4d99db304 Make a static chain of isp softcs- gdb usage becomes a lot easier.
Add in a very large amount of target mode support code- this is just
a first pass at this. It's a difficult thing because some of the code
can be in platform independent areas (see isp_target.?) but a lot has
to be in platform dependent areas because of not only the tight coupling
of received commands/events and the specific OS subsystem but because
the platform independent code has (deliberately) no event/wait mechanisms.
2000-01-03 23:55:30 +00:00
mjacob
2961770511 Raise default FCP logintime to 60 seconds. Move the position
of where we could have seen the loop up at least once so it
makes sense. Change some stuff in ispscsicmd so we don't get
stuck there if the loop has never come up yet. Add in some
target mode support code.
2000-01-03 23:52:41 +00:00
mjacob
c4a59d8a77 Support target mode operations. This involves having some variant
dma mapping callback routines to select from as target mode
entries are handled a fair bit differently from normal initiator
mode entries.
2000-01-03 23:50:13 +00:00
mjacob
f881af78c4 Role platform minor revision. Add in some target mode only
private structure definitions.
2000-01-03 22:15:16 +00:00
mjacob
da7e0459da add isp_print_qentry inline function 2000-01-03 22:14:24 +00:00
mjacob
35570fd92e Roll minor revision number and add a more finalized list
of target mode related enums.
2000-01-03 22:13:40 +00:00
mjacob
d3fb64f248 Add missing target mode flag and fix the RQSTYPE_CTIO0
to be CTIO as it should be.
2000-01-03 22:12:53 +00:00
mjacob
8f93614b09 Add in missing ENABLE TARGET MODE opcode. 1999-12-27 08:47:11 +00:00
mjacob
c016cdaa10 Oops- got the initiator and initiator/target f/w reversed for
the 1080/1240/1280 case.
1999-12-22 00:18:15 +00:00
mjacob
5cc7127495 Clean up lun width determination based upon f/w revisions
for the parallel SCSI cards (4.55..4.65 :: 8.55..8.65).
1999-12-20 01:35:04 +00:00
mjacob
2b2de7899b Clean up some f/w revision checking wrt enabling fast posting.
Make sure we set defaults sanely for dual-bus adapters.
1999-12-20 01:34:01 +00:00
mjacob
c6b83b9002 add initiator-only mode f/w for 1040 && 1080/1280/1240 1999-12-20 01:30:52 +00:00
mjacob
9e5f68a92b Add Dual LVD bus (1280) support 1999-12-16 05:42:02 +00:00
mjacob
7cc44d2aca roll platform minor 1999-12-03 06:56:43 +00:00
mjacob
28a6d19c00 clean up sprintf and have buffer that won't overflow 1999-12-03 06:56:23 +00:00
mjacob
394174889a turn some messages into CFGPRINT messages 1999-12-03 06:55:39 +00:00
mjacob
0d75a5b4eb Clean up stupidity in the isp_handle_other_response function- indexes
of queue entries have to be at least 16 bits now! If we're running
a 2100 less than rev 5, turn off loop fairness (per Qlogic errata). Fix
typo in checking against 2200 F/W revision. Slightly fix/reorder fabric
login stuff. Change to usage of isp_getrqentry for code clarity. Add some
defensive dual bus assumptions. Various cleanups, etc...
1999-11-21 03:18:22 +00:00
mjacob
1a6884ad3f Add storage/access for a default WWN. A miscellaneous tweak or two. 1999-11-21 03:15:11 +00:00
mjacob
cad8fd9aa6 Add a isp_getrqentry inline function (that is, find the next available
request queue entry if any are left).
1999-11-21 03:14:04 +00:00
mjacob
ef2cbb09ee Fix some includes for when we (eventually) get target mode working again.
Role the core version minor number. Change the arguments to the dma
setup function to use a u_int16_t for the output request loop pointer
(truly amazing that this hasn't blown up in anyones face so far). Do
some shuffling around of some items.
1999-11-21 03:12:58 +00:00
mjacob
fbdf5e31e6 Put *back* the f/w, this time with a BSD style licence as approved
by Qlogic. The firmware is now also kept from compiling by default
unless some config options are set.

While we're at it, roll the 2200 f/w to 2.01.0. Still need to get the
1.17.26 2100 f/w working as it solves a lot of problems but it doesn't
want to work yet with this driver (:-)).
1999-11-21 03:08:29 +00:00
mjacob
b2895f817a Fix dmasetup functions to have 16 bit queue indices. Get the chip revision
out of the PCI CLASS reg and store it in the softc. Use the getenv_quad
function to get a WWN override from the environment. Look for a config
value for same. Make slightly less lame the wwn seed construction.
1999-11-21 02:56:17 +00:00
gallatin
660a7daead Remove calls to alpha_register_pci_scsi(). After Mike's recent boot
changes, it no longer exists and is preventing alpha kernels from building.

reviewed by: msmith
1999-11-05 13:10:39 +00:00
mjacob
8761356627 correct moronic typo 1999-11-01 04:39:52 +00:00
mjacob
be6c08329b Organize things to cope with the (possible) lack of downloadable
firmware a bit better.
1999-10-30 19:35:11 +00:00
mjacob
55f0eea5b6 Remove firmware from tree until a better copyright from Qlogic is forthcoming. 1999-10-30 19:33:45 +00:00
mjacob
63c5b1f786 Use pointer to f/w in md structure as to whether f/w exists or not.
If firmware length isn't specified, extract from the 4th short into
the firmware.
1999-10-30 19:32:44 +00:00
mjacob
70c0d5902b I was misinformed. I cannot get away from specifying tags for FC. Some devices
are happy w/o them- some are unhappy (IBM drives).
1999-10-28 02:48:42 +00:00
mjacob
7cc511f573 nuke a debug printout I thought I had already nuked 1999-10-26 22:25:13 +00:00
mjacob
3d0daca952 remember to initialize mailbox 2 for FC isp bus resets 1999-10-22 17:03:03 +00:00
mjacob
b412a34789 Add in inclusion of machine/md_var.h (so alpha_scsi_bus_register or what
have you is prototyped). Removed code versions in md struct- not used
any more. Allocate transfer dma maps and xflist stuff in mbxdmasetup based
upon isp->isp_maxcmds. Allow for multiple calls to mbxdmasetup (for
isp_reset cases).
1999-10-17 19:03:11 +00:00
mjacob
3cefde7f1c Remove some target mode stuff. It will get re-introduced in a different
file later. Do some pencil-sharpening types of minor changes. Change
how active commands are remembered (using new inline functions to get
handles, etc..). Now do a GET FIRMWARE STATUS after firing up the f/w as
outgoing mailbox 2 will tell you the f/w's notion of the max commands
that can be supported. Attempt to retrieve loop topology. Add in the
appropriate SWIZZLE/UNSWIZZLE macros calls (this is a no-op on Little
Endian machines but is needed for sparc (on other platforms)). Move
the temp port database we use to find out where things have moved to
after a LIP to the softc and off the kernel stack. Follow Qlogic's
hint and don't bother setting a tag for commands that don't have
this enabled (presumably the f/w will do it's own selection then).
Use an INT_PENDING macro to check for an interrupt. The call to
ISP_DMAFREE now just takes the handle- not the 'handle-1' which was
a layering violation. Use CFGPRINTF in a couple of places to make
things less chatty if not booting verbose, or CAMDEBUG compiles, etc..
1999-10-17 18:58:22 +00:00
mjacob
0e371d52dc Add in isp_debug variable. It defaults to zero unless CAMDEBUG is defined
where it defaults to one. Change simq width allocation to the max number
of commands supported by the HBA after f/w fires up- not the constant
MAXISPREQUEST value. Do some stylistic changes.
1999-10-17 18:50:47 +00:00
mjacob
02123bc675 Roll platform major && minor (major now tracks FreeBSD major release).
Add in null SWIZZLE definitions. Add in CFGPRINTF define. Change default
debug level to refer to an external isp_debug variable. Remove inline
functions as they're now in isp_inline.h and include that file.
1999-10-17 18:48:16 +00:00
mjacob
a1991492ab Roll core version number. Do some stylistic changes. Ensure that
the result queue length is never less than 64. Move (ick) temp port
database used for post-LIP merging off the kernel stack and put it
into the softc. Remove some target mode stuff which will come back
later in a different file. Change how the list of outstanding commands
are stored (now allocated at mailbox setup time to be just enough for
the max for a specific HBA which can vary). Keep a rotating seed of
the last index for this in the softc. Increase the count of active
commands from 10 to 16 bits.
1999-10-17 18:45:31 +00:00
mjacob
e11b1a283a add in an INT_PENDING macro 1999-10-17 18:41:47 +00:00
mjacob
da0dfb3520 Remove target mode definitions (they'll come back later in
a different file).
1999-10-17 18:41:21 +00:00
mjacob
a454db3997 Add a file where inline functions for the Qlogic isp cards can go. This reduces
duplication in all the platform specific header files.
1999-10-17 18:15:05 +00:00
mjacob
baa2680edb roll 10[24]0 and 1080/12X0 f/w 1999-10-17 18:09:34 +00:00
mjacob
654b01bbf1 Until we actually support SBus, there's no reason to keep the f/w in the tree. 1999-10-15 19:00:50 +00:00
mjacob
e003de9fed remove unnecessary includes 1999-10-11 19:30:59 +00:00
peter
3b842d34e8 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
bde
faf95163e9 Cast pointers to uintptr_t instead of casting them to u_long, and/or vice
versa.  Cosmetic.
1999-08-24 00:56:50 +00:00
mjacob
8d3a26ca22 Clarify and cleanup some CAM queueing breakages. 1999-08-16 20:11:45 +00:00
mjacob
7cf8f73eb3 add in SIMQFRZ_TIMED && CMD_RQLATER defines 1999-08-16 20:04:06 +00:00
mjacob
527a780d1c add in new ICB structure variant (for 2200) 1999-08-16 20:02:09 +00:00
mjacob
83f6224191 Clarify lun limits for FC && SCSI. 1999-08-16 20:01:14 +00:00
mjacob
cc66879518 More code cleanup. Go back to using FULL_LOGIN Fibre Chan if f/w is less than
1.17.0 level. Change where we do the loop database init. Add in the CMD_RQLATER
return. Add some register debounce.
1999-08-16 19:59:55 +00:00
mjacob
2c1579fa58 Set some correct return values. Prefer I/O map all the time unless configured
otherwise.
1999-08-16 19:52:29 +00:00
gibbs
c1664fa91a 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.
1999-08-16 01:52:21 +00:00
mjacob
43143c0b17 add in (controlled by option) 2200 Expanded Lun F/W 1999-07-06 05:38:24 +00:00
mjacob
85059d8401 add in a boot environment isp_disable flag 1999-07-06 01:24:20 +00:00
mjacob
63bce97701 Wow- too much breakage..wait until you compile it, buckwheat... 1999-07-05 22:04:08 +00:00
mjacob
e1b443309a Oops- got sense of ifdef wrong 1999-07-05 22:01:48 +00:00
mjacob
4593eb629f add 2200 f/w; fix botched define 1999-07-05 20:42:08 +00:00
mjacob
0cbdaca922 add ISP_DISABLE_2200_SUPPORT defines; Add reference to 2200 F/W 1999-07-05 20:24:46 +00:00
mjacob
27c7b98382 Well, don't try and probe 65535 luns- things just don't really work well
when this happens. Limit to 16 luns for the 2100/2200 for now.
1999-07-03 01:44:05 +00:00
mjacob
d6b6f6217d Remove pre-CAM code. Add in getenv_int calls for variables isp_mem_map,
isp_io_map, isp_no_fwload, isp_fwload, isp_no_nvram, isp_fcduplex
which are all bitmaps of isp instances that should or shouldn't
map memory space, I/O space, not load f/w, load f/w, ignore nvram,
not ignore nvarm, set full duplex mode. Also have an isp_seed value
that we can use to generate a pseudo seed for a synthetic WWN.
Other minor cosmetic cleanup. Add in support for the Qlogic ISP
2200. Very important change where we actually check now to see
whether we were successful in mapping request and response queues
(and fibre channel scratch space).
1999-07-02 23:18:03 +00:00
mjacob
6f32038c30 Remove all pre-CAM code. Fix breakage for SCCLUN when it is in fact
ISP2100_SCCLUN. Make changes for how ISPASYNC_PDB_CHANGE_COMPLETE
is now ISPASYNC_PDB_CHANGED. Add in ISPASYNC_FABRIC_DEV case.
1999-07-02 23:12:58 +00:00
mjacob
20edd70b1f Merge defunct isp_freebsd_cam.h into this file. Do some appropriate
changes like rolling minor revision levels and defines where we now
do default WWN seeding in the platform files.
1999-07-02 23:10:34 +00:00
mjacob
1c323f5567 Roll revision levels. Add support for the Qlogic 2200 (warn about
not having SCSI_ISP_SCCLUN config defined if we don't have f/w for
the 2200- it's resident firmware uses SCCLUN (65535 luns)). Change
the way the default LoopID is gathered (it's now a platform specific
define so that some attempt at a synthetic WWN can be made in case
NVRAM isn't readable).

Change initialization of options a bit- don't use ADISC. Set
FullDuplex mode if config options tells us to do so. Do not use
FULL_LOGIN after LIP- it's the right thing to do but it causes too
much loop disruption (Loop Resets). Sanity check some default
values. Redo construction of port and node WWNs based upon what we
have- if we have 2 in the top nibble, we can have distinct port
and node WWNs. Clean up some SCCLUN related code that we obviously
had never compiled (:-(). Audit commands coming int ispscsicmd and
don't throw commands at Fibre devices that do not have Class 3
service parameters TARGET ROLE defined.

Clean up f/w initialization a bit. Add Fabric support (or at least
the first blush of it). Whew - way too much to describe here.
Basically, after a LIP, hang out until we see a Loop Up or a Port
DataBase Change async event, then see if we're on a Fabric
(GET_PORT_NAME of FL_PORT_ID). If we are, try and scan the fabric
controller for fabric devices using the GetAllNext SNS subcommand.
As we find devices, announce them to the outer layer. Try and do
some guard code for broken (Brocade) SNS servers (that get stuck
in loops- gotta maybe do this a different way using the GP_ID3 cmd
instead).  Then do a scan of the lower (local loop) ids using a
GET_PORT_NAME to see if the f/w has logged into anything at that
loop id. If so, then do a GET_PORT_DATABASE command.  Do this scan
into a local database. At this point we can say the loop is 'Ready'.
After this, we merge our local loop port database with our stored
port database- in a as yet to be really fully exercised fashion we
try and follow the logic of something having moved around. The
first time we see something at a Loop ID, we fix it, for the purpose
of this system instance, at that Loop ID. If things shift around
so it ends up somewhere else, we still keep it at this Loop ID (our
'Target') but use the new (moved) Loop ID when we actually throw
commands at it. Check for insane cases of different Loop IDs both
claiming to have the same WWN- if that happens, invalidate both.
Notify the outer layer of devices that have arrived and devices
that have gone away. *Finally*, when this is done, search the
softc's database of Fabric devices and perform logout/login actions.
The Qlogic f/w maintains logout/login for all local loop devices.
We have to maintain logout/login for fabric devices- total PITA.
Expect to see this area undergo more change over time.
1999-07-02 23:06:38 +00:00
mjacob
858e488283 Roll revision levels. Move DEFAULT_LOOPID definition to platform files.
Change some fcp parameter structures such that we can get the portid
(24 bit value), get both node and port WWN, know whether we're on a fabric
or not, note whether we've ever seen the loop up, and note the current
state of the loop.

Replace the isp_pdb_t structure in fcparams with a reduced cost structure
that maintains a static relationship to 'Target', but can have the actual
loop ID used change (in case, post LIP, we discover things have moved
around). This also retains portid and node/port WWNs.  This array gets
larger if we have fabric support compiled in.

Note special loop IDs that are invariate for this device- FL_PORT_ID
(0x7e) which tells us if there's a fabric controller present, FC_PORT_ID
and FC_SNS_ID (fabric controller port and fabric SNS server port). We don't
use the latter two for anything. IDs above FC_SNS_ID up through 255 are
available for mapping fabric devices to 'target' ids.

Add in a config define to set FC full duplex mode. Add in a define to
recognize the Qlogic 2200 boards. Add comments about ISPCTL commands.
Add and change some ISPASYNC enumes.
1999-07-02 22:46:31 +00:00
mjacob
f83d767929 Add in SNS and Fabric login/logout commands. Clean up ICBOPT defines.
Remove INVALID_PDB_OPTIONS defines. Define generic SNS request and
response structures and the bare minimum GAN and GP3 subcommands.
1999-07-02 22:31:11 +00:00
mjacob
2ccc70b276 This file is now obsolete. 1999-07-02 22:26:10 +00:00
mjacob
8c8dee827f roll firmware for FC 1999-07-02 17:07:39 +00:00
mjacob
be4c63bf19 (corrections for type change in softc) 1999-06-24 16:42:33 +00:00
mjacob
1d3007c47d Bruce pointed out I was being silly with volatile.
Submitted by:	bde@freebsd.org
1999-06-24 16:34:00 +00:00
mjacob
ac97e7ad36 When asked to get the current transfer settings go do a dev_refresh
isp_update call to get a better chance at seeing whether a recent
settings change has latched up.
1999-05-12 19:00:16 +00:00
mjacob
7947793359 be a bit more chatty about some speed negotiations 1999-05-12 18:56:55 +00:00
mjacob
d6302276db A large set of changes to handle dual bus adapters. 1999-05-11 05:10:06 +00:00
mjacob
fff99b2c79 Some massive thwunking in initialization to handle dual bus adapters. More
massive thwunking to include an XS_CHANNEL value. Some changes of how
parameters are reported to outer layers (including bus, e.g.). Yet more
stirring around in isp_mboxcmd to try and get it right. Decode of 1080/1240
NVRAM.
1999-05-11 05:06:55 +00:00
mjacob
be77678d66 Add in SCSI_QFULL definitions. Add in local storage for second SIM for
dual bus adapters. Add in XS_CHANNEL macro to get at it.
1999-05-11 05:04:24 +00:00
mjacob
a787bcc937 Clean up some sprintfs. Add in a SCSI_QFULL an XS_CHANNEL definition
for 2.X versions. Disable fast posting for FC.
1999-05-11 05:03:33 +00:00
mjacob
5a7d527195 Roll core minor number. Re-layout a lot of SCSI fields to accomodate multiple
bus adapters.
1999-05-11 05:02:23 +00:00
mjacob
352b4ebe9e Clean up some macros. Add in ISP 1080/1240 NVRAM layout definitions. 1999-05-11 05:01:26 +00:00
mjacob
1f0c5e57fe add a couple of missing commands 1999-05-11 05:00:35 +00:00
mjacob
f98dc1ea4a Clean up 2.2.X support (which might have to be cleaned up again
after some of the previous commits). Add in support for the 1240
dual channel ISP card. Try the dance of unmapping a PCI interrupt
if we don't configure (if that ever works it'll be helpful).
1999-05-11 04:53:57 +00:00
mjacob
df4c32cbf2 roll ISP 1080/1240 f/w 1999-05-11 02:56:34 +00:00
peter
41b420910c 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.)
1999-05-09 17:07:30 +00:00
ken
2bb789d7a3 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)
1999-05-06 20:16:39 +00:00
peter
d6f4bd18f5 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.
1999-04-24 20:17:05 +00:00
mjacob
b629cd30ab temp fix for internal queue overflow problem 1999-04-14 17:37:36 +00:00
eivind
57f5464515 Staticize. 1999-04-11 02:50:42 +00:00
mjacob
995672f848 Make firmware revision a triple. Clean up some FC init stuff for
board versions with no BIOS. Separate mailbox interrupts from
IOCB interrupts. Read OUTMAILBOX5 while RISC_INT is active- not
after you clear it (potential race condition). Clear out older broken
BIG_ENDIAN goop. Don't negotiate narrow/async for LVD busses at startup
if already in LVD mode. Note usage of presumptive 1040C revision. For
all the LIP, PDB Changed, Loop UP/DOWN async events, mark fw state
as unknown as well as marking the need to do a getpdb on targets- after
a LIP for certain the f/w has to do PRLI/PLOGI for all targets again
and marking f/w state as unknown gives us a fighting chance to (start
to) hold up for that to complete.
1999-04-04 02:28:29 +00:00
mjacob
b862ecf9c2 oops on this last 1999-04-04 02:22:42 +00:00
mjacob
0db59f8916 F/W revisions now a tuple (not a duple). Fix pre-CAM code. 1999-04-04 01:35:03 +00:00
mjacob
ba4a1207d0 Fix for pre-CAM kernels (again). Turn back on fast posting. 1999-04-04 01:34:06 +00:00
mjacob
e4882bb39a Remove incorrect BIG_ENDIAN defines and substitute in the SBus only macros
that will SBusify an isp header or the lun/target portions of a request IOCB-
and have these only valid iff __sparc__ (no non-sparc SBus machine that *I*
know about).
1999-04-04 01:32:09 +00:00
mjacob
5a55ebd1ad Change f/w revision to major,minor,micro version. Add in ISP1040C definition. 1999-04-04 01:26:08 +00:00
mjacob
24e93e64ed roll ISP1040 and ISP2100 f/w to latest release 1999-04-04 01:20:25 +00:00
mjacob
7ff85e7993 Read the board revision and trim cache line size back from 16 to 1
for early revision 2100 boards. Make sure to turn ROM off for these
boards.
1999-04-04 01:14:02 +00:00
mjacob
6535dd177e Annoying little nigglet- apparently *some* Qlogic temporarily ignore
settings you've just sent them and return random values if you follow
the set by a get. This causes problems when you latter run a Tag-enabled
command when you've command tagged mode off.
1999-03-26 00:33:13 +00:00
mjacob
1a6850fac8 enable 1080 LVD support 1999-03-25 22:53:56 +00:00
mjacob
cf2cd94c71 Add in 1080 LVD support and some basis also for the 1240. The port database
printout is now enabled.
1999-03-25 22:52:45 +00:00
mjacob
906357626b roll internal tag level 1999-03-25 19:53:54 +00:00
mjacob
1ff8139269 roll internal tag level 1999-03-25 19:47:33 +00:00
mjacob
7b78dc4e25 Prep for 1080/1240 support. Those fine h/w engineers at Qlogic
gave yet another internal register layout model for what is
*still* the same architecture. I hope they saved billyuns of gates
'coz otherwise this is *really* annoying.
1999-03-17 05:07:18 +00:00
mjacob
a319ea8341 A wad of changes- prepping for 1080/1240 support (which caused a massive
thwank in register layout goop). A different mboxcmd approach. Some PDB change
infrastructure. Some better management of loopdown/loopup events (keep them
distinct from resource starvation for simq freeze/unfreeze actions).
1999-03-17 05:04:39 +00:00
mjacob
866792d022 Cleanup. Set all PCI parameters of importance. Set a define that will
allow us via config options prefer mem space to I/O space.
1999-02-09 01:12:52 +00:00
mjacob
f5609b3fa5 Roll internal release tag. Roll core version minor. Fix broken DPARM_DEFAULT
define. Add a new config flag param (ISP_CFG_NONVRAM) whose intent it is
to cause NVRAM to be ignored. Add ISPASYNC_LOOP_DOWN and ISPASYNC_LOOP_UP
isp_async enums.

Amazingly enough, I did all my scsi_sa work recently without realizing
that I had a broken isp card whose (unchangeable- it's an old old old
isp1020) NVRAM has sync mode enabled, but disconnect/reconnect disabled-
the ISP_CFG_NONVRAM is definitely warranted when you want to bloody well
ignore the NVRAM and set something sensible.
1999-02-09 01:11:35 +00:00
mjacob
4cdff6d031 clean up some NVRAM defines 1999-02-09 01:09:35 +00:00
mjacob
d42d56559f Add in defines that disable (temp) fast posting. 1999-02-09 01:09:03 +00:00
mjacob
1815bac109 Allow fibre channel 'bus resets' to go through. Handle Loop Down/Loop Up
events by freezing/unfreezing the simq- nice to have such control at this
level! Do bus resets in attach layer (non-CAM defined code).
1999-02-09 01:08:38 +00:00
mjacob
831285f634 Roll internal release tag. Print out if we're in a 64 bit PCI slot.
Use fast memory timing NVRAM parameter. Clean up and fix establishment
of default target parameters. Don't use NVRAM if are flagged as not to
do so (I had a busted NVRAM setup which I couldn't edit that enabled SYNC
mode but disabled disconnect/reconnect and wide!!). Fix delays after
resets. BUS resets not done in isp_init anymore- relegated to OS
specific outer layers. Fix a buglet where you can get in a loop for
a NULL xs in the completion list in isp_intr. Add in some defines that
can disable fast posting. Add in code for Loop Up/Loop Down events that
call into the outer layers as to what to do.
1999-02-09 01:07:06 +00:00
mjacob
4afa695118 roll internal release tag 1999-02-09 01:05:42 +00:00
mjacob
1f0261f40f Implement and use Fast Posting for both parallel && fibre. Redo a bit of
the startup code. Implement a call to outer framework function so that
asynchronous events can be handled (e.g., speed negotiation, target mode).

Roll internal release tags.
1999-01-30 07:29:00 +00:00
mjacob
88b025083d Grrr.. Do the *correct* and *usable* 1.31 firmware. You have to power
cycle to get rid of the old 1.31 firmware. *@!$&^@&$!&^&^!!!!!

But anyway comment it out and use new SBus 7.55 firmware. We get fast posting
with this as well as 32 luns and target mode support.

(not that this is used yet in FreeBSD, but it's ready for FreeBSD-sparc
whenever it happens....)
1999-01-30 07:22:30 +00:00
mjacob
50b0c4669d roll internal release tag 1999-01-30 07:20:50 +00:00
mjacob
3e8f15f133 roll internal release tag 1999-01-30 07:08:55 +00:00
mjacob
734cdad430 Suggested by bde@freebsd.org- memcpy not necessarily good to use. D'oh- not in
the BSD DKI. Stop being lazy and finish the defines so MEMCPY becomes bzero
for FreeBSD.
1999-01-10 11:15:23 +00:00
mjacob
ff7067b486 Add some prototype deadchip detection. Set FIFO bursting (1XX0 only-
it's already on for the 2XX0) and detect the broken 1040A FIFO. Change
bzero to MEMZERO (portability with **nux). Use memcpy for same reason.

Finally detect QUEUE FULL conditions and return this as an error that
will get cam_periph_error to do it's 'tagged openings now XXX' dance.
1999-01-10 02:55:10 +00:00
mjacob
418e56ef2d up isp_fifo_threshold NVRAM storage to 3 bits (for future 128 bit) 1999-01-10 02:51:48 +00:00
mjacob
8ae72d61ed add MEMZERO portability defines 1999-01-10 02:51:06 +00:00
mjacob
da7bad3421 Amazingly stupid forgetfullness had me forgetting to turn on FIFO bursts
for the 1XX0 cards. That cost > 50% performance.
1999-01-10 02:45:51 +00:00
mjacob
5c42627795 clarify headers;ansify 1998-12-28 19:24:23 +00:00
mjacob
13ecc0c78f clarify headers;move uninit to outer layer;remove watchdog 1998-12-28 19:22:27 +00:00
dillon
1b46557c21 probe function changed from returning char * to const char *. 1998-12-14 06:37:37 +00:00
mjacob
ad9bd899c9 oops on last 1998-12-05 01:46:40 +00:00
mjacob
6b499c42bc Remove the Target mode functions until they're in better shape. Implement some
suggested compilation cleanups from Eklund. Wire down a hard loop id if we are
not on a platform that has the ability to get to a PCI BIOS (it still will
float to the ID it gets after a LIP but at least we can try). Clarify that the
expanded lun is based upon SCCLUN defines (in f/w).
1998-12-05 01:33:57 +00:00
mjacob
ee4de20504 make a real "done" func; clarify some LUN widths 1998-12-05 01:31:21 +00:00
mjacob
993b50af59 compilation fixes from Eklund 1998-12-05 01:30:52 +00:00
mjacob
ba9a0c9f21 compilation fixes from Eklund && move XS_CMD_DONE to be a real function 1998-12-05 01:30:27 +00:00
mjacob
2dd2c8d11c do a bit of cleanup on some target mode structures and clarify a couple other minro things 1998-12-05 01:29:43 +00:00
mjacob
8500a9a7a3 roll core version minor and wire a non-i386 default Loop ID to 113 1998-12-05 01:28:38 +00:00
mjacob
9a7bd192e5 offset was wrong for HARDLOOPID in NVRAM 1998-12-05 01:07:52 +00:00
mjacob
5847a18836 Roll to 1.15 f/w level for Qlogic 2100. Leave all flavors in, but control which
one gets compiled in by default. The default is private loop, non-expanded lun.
1998-12-05 00:47:25 +00:00
mjacob
6e55d5d8b1 roll to 1.31 level 1998-12-05 00:38:31 +00:00
mjacob
0ff3e17e01 trivial header fix 1998-12-05 00:07:04 +00:00
archie
982e80577d 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>
1998-12-04 22:54:57 +00:00
gibbs
8111be0235 -Wunused cleanup.
Submitted by:	Poul-Henning Kamp <phk@freebsd.org>
1998-10-15 23:46:33 +00:00
gibbs
f3dbbe3c84 Honor CAM_TAG_ACTION_NONE. 1998-10-15 23:17:58 +00:00
mjacob
79798ff9eb Andrew Gallatin reported some internal queue overflows with MAXISPREQUEST
at 256. So- to be safe, let's roll back to 64 while we do some more
investigating.
1998-10-14 16:55:00 +00:00
dfr
36a8222236 Add hooks so that the alpha can detect which disk has the root partition. 1998-09-26 14:37:49 +00:00
mjacob
2426c8b34c Bump request queue size up to full amount (now that we have
a contiguous CCB memory allocation).
1998-09-18 18:58:07 +00:00
mjacob
4cc465448d (requested by gibbs) Remove the SCSI_CAM option (and rework the isp driver
that had depended on it for compilation within or without CAM to use
__FreeBSD_version instead).
1998-09-18 00:46:42 +00:00
mjacob
00163848c1 per bde (who is right about this) that an inlined fucntion with const
char * strings being returned defined in a header file included several
places but only used in one module, is, uh, silly.
1998-09-17 23:20:29 +00:00
mjacob
cbc05032bc Cleanliness. Don't leave defined a const char array that's only used
if target mode is defined (which it isn't, yet).
1998-09-17 22:53:35 +00:00
mjacob
2b203e82ec A major amount of cleaning up:
+ Change some messages about CCB memory allocation
	+ Turn a failure to DMA map all of a transaction due to lack of
	  ISP queue entries into a requeue operation (instead of the
	  case where it had been treated the same as a DMA too big
	  operation).
	+ put back splsoftvm around bus_dmamap_load calls.
	+ cleanup (and fix a glaring bug) in the and of the dma setup
	  routine. Also, the dma setup routines either return CMD_QUEUED
	  (for success) or CMD_COMPLETE (for failure) or CMD_EAGAIN
	  (for requeuing for resource shortage reasons).
1998-09-17 21:11:21 +00:00
mjacob
45723eb957 Clean up a comment. Make the default debugging level contingent upon CAMDEBUG. 1998-09-17 21:06:38 +00:00
mjacob
1f41f720c7 Remove commented out and no longer pertinent EAGAIN message. Redo CMD_COMPLETE
logic for returns from inner layer (just make sure that a CAM_REQ_INPROG
doesn't get xpt_done'd).
1998-09-17 21:05:40 +00:00
mjacob
4d3cd8e51f ISP_DMASETUP now returns a value to be possibly punted to outer layers.
Turn request queue overflow messages into debug messages. Ensure on
isp_restarts that we nullify the xflist array.
1998-09-17 21:03:45 +00:00
mjacob
9dad24d2f6 Roll revision, clean up a comment. 1998-09-17 21:02:18 +00:00
mjacob
5b2097bd6c Fix the (unported) resource shortage case- I'd done a xpt_freeze_simq
but had never done a CAM_RELEASE_SIMQ to restart the queues.
1998-09-16 19:52:22 +00:00
mjacob
d85d94f4f7 Alpha port related fixes from Doug Rabson.
Submitted by:	dfr
1998-09-16 16:43:17 +00:00
mjacob
c773a864d9 alpha port fixes from Doug.
Reviewed by:	dfr
1998-09-16 16:42:40 +00:00
mjacob
ee0c7c1d4f fix reported compile error flying blind- I do not have the new compiler yet 1998-09-15 22:44:51 +00:00
gibbs
ec8a52546b Convert ISP pci front end to CAM/bus space/dma.
Convert ncr driver to CAM.
1998-09-15 10:06:23 +00:00
gibbs
331be1099c Contents were duplicated. 1998-09-15 09:59:37 +00:00
gibbs
dbf36c8a08 Update QLogic ISP support for CAM. Add preliminary target mode support.
Submitted by:	Matthew Jacob <mjacob@feral.com>
1998-09-15 08:42:56 +00:00
bde
d09c7eccb2 Use [u]intptr_t instead of [unsigned] long to convert and/or represent
pointers.

This finishes fixing conversions between pointers and integers of
possibly different sizes in GENERIC.
1998-08-10 17:21:49 +00:00
mjacob
a3b54b46a3 minphys means something different in FreeBSD than in NetBSD- not needed here and in the way 1998-07-25 04:48:25 +00:00
bde
925110cd23 Fixed printf format errors (only 1 left in GENERIC now). 1998-07-13 09:53:11 +00:00
bde
566ee5c323 Fixed pedantic semantics errors (bitfields not of type int, signed int
or unsigned int (this doesn't change the struct layout, size or
alignment in any of the files changed in this commit, at least for
gcc on i386's.  Using bitfields of type u_char may affect size and
alignment but not packing)).
1998-06-08 09:47:47 +00:00
bde
f557c431ce Support compiling with `gcc -ansi'. Just use __inline instead of inline.
[__]inline is only used to bloat the code here.  It gives a separate copy
of all the strings for each time this header is included...

Fixed misuse of __P(()).
1998-05-01 18:10:50 +00:00
mjacob
7d48e85bb7 Oops- osreldate.h is not around like I thought it would be... hmmm.. quick fix to get around this 1998-04-24 18:23:20 +00:00
mjacob
8cd3efb7df Add support for the Qlogic ISP SCSI && FC/AL Adapters 1998-04-22 18:12:29 +00:00
mjacob
a9113b6f9b Add support for the Qlogic ISP SCSI && FC/AL Adapters 1998-04-22 17:54:58 +00:00