Commit Graph

613 Commits

Author SHA1 Message Date
Matt Jacob
abeda21e8d Temp workaround for config_intrhook_establish running the hook
right away.
2007-05-13 17:45:00 +00:00
Matt Jacob
f58a08937b Bad merge. 2007-05-11 13:47:28 +00:00
Matt Jacob
0230a28bf4 Fix pointy-hat problem with BUS_DMA_ROOTARG macro that caused problems for sparc64.
Candidate for immediate MFC.

Noticed by: Everyone-maxim contacted.
2007-05-11 06:28:26 +00:00
Matt Jacob
0a70657fcc Make this an MP safe driver but also still be multi-release.
Seems to work on RELENG_4 through -current and also on sparc64
now. There may still be some issues with the auto attach/detach
code to sort out.

MFC after:	3 days
2007-05-05 20:17:23 +00:00
Scott Long
8008a935a7 Revert a driver API change to xpt_alloc_ccb that isn't necessary. Fix a
couple of associated error checks.
2007-04-18 04:58:53 +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
Matt Jacob
9a1b0d43c2 Temporarily desupport simultaneous target and initiator mode.
When the linux port changes were imported which split the
target command list to be separate from the initiator command
list and the handle format changed to encode a type in the handle
the implications to the function isp_handle_index (which only
the NetBSD/OpenBSD/FreeBSD ports use) were overlooked.

The fault is twofold: first, the index into the DMA maps
in  isp_pci is wrong because a target command handle with
the type bit left in place caused a bad index (and panic)
into dma map. Secondly, the assumption of the array
of DMA maps in either PCS or SBUS attachment structures is
that there is a linear mapping between handle index and
DMA map index. This can no longer be true if there are
overlapping index spaces for initiator mode and target
mode commands.

These changes bandaid around the problem by forcing us
to not have simultaneous dual roles and doing the appropriate
masking to make sure things are indexed correctly. A longer
term fix is being devloped.
2007-04-02 01:04:20 +00:00
Matt Jacob
9f9e9ae3a7 Fix compilation problem (add a const) for pre-7.0 compiles. 2007-03-31 21:01:35 +00:00
Matt Jacob
c6048aee5d some minor error message cleanups 2007-03-29 21:29:26 +00:00
Matt Jacob
2e35504d71 Don't derference a pointer before setting it.
Very Pointy Dunce Cap T o: me.
Submitted by:	Marcel
MFC after:	3 days
2007-03-28 16:34:11 +00:00
Matt Jacob
5f634111fa MFP4: a) Some constification from NetBSD (gcc 4.1.2)
b) Split default param fetching/setting into scsi and fibre functions
and retry the fibre fetch more than once.

MFC after:	1 week
2007-03-22 23:38:32 +00:00
Matt Jacob
f6a6ae8f5c Don't call isp_intr from isp_start- this seems to, in rare cases,
cause confusion with at least the 23XX chipsets where the output
queue index pointer just gets a bit whacko.

MFC after:	1 day
2007-03-14 05:58:07 +00:00
Matt Jacob
6a7d12e1a8 Move bus_space_tag and bus_space_handle register access
tokens into the common isp_osinfo structure instead of being
in bus specific structures. This allows us to implement
a SYNC_REG MEMORYBARRIER call (using bus_space_barrier)
and also reduce the amount of bus specific wrapper structure
usages in isp_pci && isp_sbus.

MFC after:	3 days
2007-03-13 06:46:08 +00:00
Matt Jacob
9418a60cb0 Restore optr if you trash it for 24XX target mode.
MFC after:	3 days
2007-03-13 06:44:07 +00:00
Matt Jacob
70273f9064 Fix compilation issues found in RELENG_4 port and merge the
diffs back to -current to keep versions identical.
2007-03-12 04:54:30 +00:00
Matt Jacob
e48b2487a0 Fix some stupid copyright mistakes that have been there for quite some time. 2007-03-10 02:39:54 +00:00
Matt Jacob
5f53837698 Redo previous newbus related change to be kinder to
multi-release support.
2007-02-23 23:13:46 +00:00
Matt Jacob
af4394d40a Don't attempt to load illegal hard loop addresses into
an ICB. This shows up on card restarts, and usually for
2200-2300 cards. What happens is that we start up,
attempting to acquire a hard address. We end up instead
being an F-port topology, which reports out a loop id
of 0xff (or 0xffff for 2K Login f/w). Then, if we restart,
we end up telling the card to go off an acquire this loop
address, which the card then rejects. Bah.

Compilation fixes from Solaris port.
2007-02-23 21:59:21 +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
ffcf6651a0 Use the new xpt_rescan function to truly now have dynamic
attachment of new devices that arrive (and we notice them
via async Fibre Channel events). We've always had the
right thing (of sorts) happen when devices go away- this
is the corollary function that makes multipath failover
actually work.

MFC after:	2 weeks
2007-02-23 05:51:57 +00:00
Matt Jacob
336b56124b There is a problem in setting/getting 'options'- if we check things
early, we haven't set board type, so we can't correctly check for
some options.  Fix this by splitting option setting/getting into
generic, pci and then later board specific, option setting/getting.

This was noticed when setting 'iid' (or 'hard loop id') didn't work
all of a sudden.

Noticed by: Mike Drangula (thanks!) via Jung-uk Kim (thanks!)
2007-02-23 05:42:41 +00:00
Matt Jacob
1b960c0b77 Be a bit more restrictive about printing out 'bad' pdb entries
during loop rescans. They're not bad so much as unstable, so
don't print this stuff out unless ISP_LOGSANCFG is set.
2007-02-23 05:39:58 +00:00
Luigi Rizzo
33d5497079 Cleanup and document the implementation of firmware(9) based on
a version that i posted earlier on the -current mailing list,
and subsequent feedback received.

The core of the change is just in sys/firmware.h and kern/subr_firmware.c,
while other files are just adaptation of the clients to the ABI change
(const-ification of some parameters and hiding of internal info,
so this is fully compatible at the binary level).

In detail:
- reduce the amount of information exported to clients in struct firmware,
  and constify the pointer;

- internally, document and simplify the implementation of the various
  functions, and make sure error conditions are dealt with properly.

The diffs are large, but the code is really straightforward now (i hope).

Note also that there is a subtle issue with the implementation of
firmware_register(): currently, as in the previous version, we just
store a reference to the 'imagename' argument, but we should rather
copy it because there is no guarantee that this is a static string.
I realised this while testing this code, but i prefer to fix it in
a later commit -- there is no regression with respect to the past.

Note, too, that the version in RELENG_6 has various bugs including
missing locks around the module release calls, mishandling of modules
loaded by /boot/loader, and so on, so an MFC is absolutely necessary
there.  I was just postponing it until this cleanup to avoid doing
things twice.

MFC after: 1 week
2007-02-15 17:21:31 +00:00
Matt Jacob
392695e05c add a missing piece for 2432 2007-02-10 04:00:57 +00:00
Matt Jacob
41675df008 Putative untested 2432 (PCI-E) support. 2007-02-10 03:33:09 +00:00
Matt Jacob
f9734398e3 Clean up some of the various platform and release specific dma tag
stuff so it is centralized in isp_freebsd.h.

Take out PCI posting flushed in qla2100/2200 register reads except for
2100s.
2007-01-23 00:02:29 +00:00
Marius Strobl
c2175ff5ca Change the remainder of the drivers for DMA'ing devices enabled in the
sparc64 GENERIC and the sound device drivers known working on sparc64
to use bus_get_dma_tag() to obtain the parent DMA tag so we can get rid
of the sparc64_root_dma_tag kludge eventually. Except for ath(4), sk(4),
stge(4) and ti(4) these changes are runtime tested (unless I booted up
the wrong kernels again...).
2007-01-21 19:32:51 +00:00
Matt Jacob
8ada63303e Grumble- let a linux-ism slip in and had an llx which
then choked on a 64 bit platforms. Oops.
2007-01-20 07:38:31 +00:00
Matt Jacob
6c81a0aecb MFP4: Move default setting to the end of isp_reset instead of the
front of isp_init so we can read NVRAM even if we're role ISP_NONE.
Prepare for reintroduction of channels (for FC) for N-Port
Virtualization.

Fix a botch in handle assignment that caused us to nuke one device
when a new one arrives and end up with two devices with the same
identity in the virtual target mapping table.
2007-01-20 04:00:21 +00:00
Matt Jacob
d4c8377f6c RELENG_6 compilation 2007-01-05 23:01:54 +00:00
Matt Jacob
5ccae6a508 error print cleanup && turn off ints if RISC is paused 2007-01-05 23:01:35 +00:00
Matt Jacob
450ca4603d Check the return from registering FC4 types with the fabric name
server.

Don't complain about a hard loop id of 0xffff- we get this in
point-to-point topologies with the 2300 and 2K Login firmware.

Up the timeout on register FC4 types commands.
2007-01-05 22:59:26 +00:00
Matt Jacob
06cacb29ca Restore revision 1.126 that got accidentally nuked. 2006-12-18 23:53:39 +00:00
Matt Jacob
805e1f828c Add back some CAM_NEW_TRAN code to make backporting to RELENG_6 easier. 2006-12-18 23:50:30 +00:00
Matt Jacob
a4f3a2bef4 Try an experiment with using DMA to load firmware into a 2200- VERIFY
CHECKSUM fails. Oh well, but keep a couple of the changes.

Avoid overflow in usec counters when waiting for mailbox completion.
2006-12-17 16:59:19 +00:00
Matt Jacob
3bda7a83b0 Implement ISP_RESET0 for PCI and SBUS attachments- isp_reset has
been modified to call ISP_RESET0 if it fails to do a reset. This
gives us a chance to disable interrupts.
2006-12-16 05:54:29 +00:00
Matt Jacob
3cce220cba Remove dependency on ispfw and firmware as modules.
Either they're there early and the ispfw sets have
registered themselves, or they're not.

The module dependency stuff isn't quite what we want
anyway. If the user doesn't want the load placed on
system memory by loading the firmware, they don't
specify it to be loaded (either by being linked in
or via being a module to be loaded and then hooked
in with firmware(9)). It doesn't then make sense to
then override what they want by pulling it in anyway.

This might be able to work if we were able to pull in
just exactly what we needed for the card we have- but
that's an optimization left for the future.
2006-12-10 03:41:48 +00:00
Matt Jacob
6890d7af94 clarify a comment slightly 2006-12-09 01:33:55 +00:00
Matt Jacob
9b03492a7d Find another spot where tagged command queueing got
accidentally nuked.
2006-12-09 01:30:05 +00:00
Matt Jacob
dd9fc7c319 Make ISPCTL_PLOGX find a handle to log into the management server
with- not hope for the best. Change some things which were gated
off of 24XX to be gated off of 2K login support. Convert some
isp_prt calls to xpt_print calls.
2006-12-05 07:50:23 +00:00
Matt Jacob
351c7054ea Add a chip timeout to ENABLE/MODIFY/DISABLE lun calls.
MFC after:	1 month
2006-12-05 07:49:15 +00:00
Matt Jacob
b61386a482 Fix XPT_GET_TRANSPORT_SETTINGS to zero validity and flags-
this was causing us to not negotiate sync at all, or at
random.
2006-12-03 07:22:15 +00:00
Matt Jacob
04697f7aa3 Make the SAN login/logout stuff more common between different chipsets
and provied an isp_control entry point so that the outer layers can
do PLOGI/LOGO explicitly. Add MS IOCB support. This completes the cycle
for base support for SMI-S.
2006-11-18 03:53:16 +00:00
Matt Jacob
6301ffe515 Disable code to set max read byte count on the 2400.
It caused a panic in writing the config register on a system. Turn
it off until we take the time to understand it.

Reported by and Testing by: Anton
2006-11-17 17:32:45 +00:00
Matt Jacob
2cad1d9857 Increase the timeout for some SAN commands.
Only complain about FC Reponse errors if they're nonzero.

Shorten some PortID printouts for local loop.

Add an internal isp_xcmd_t data structure which we'll use for some
CT-Passthru support as part of adding SMI-S.
2006-11-16 00:39:56 +00:00
Matt Jacob
e49f99cd9f minor change to reduce some diff noise 2006-11-16 00:31:46 +00:00
Matt Jacob
f7c631bcf0 Push things closer to path failover by implementing loop down and
gone device timers and zombie state entries. There are tunables
that can be used to select a number of parameters.

loop_down_limit - how long to wait for loop to come back up before
declaring
all devices dead (default 300 seconds)

gone_device_time- how long to wait for a device that has appeared
to leave the loop or fabric to reappear (default 30 seconds)

Internal tunables include (which should be externalized):

quick_boot_time- how long to wait when booting for loop to come up

change_is_bad- whether or not to accept devices with the same
WWNN/WWPN that reappear at a different PortID as being the 'same'
device.

Keen students of some of the subtle issues here will ask how
one can keep devices from being re-accepted at all (the answer
is to set a gone_device_time to zero- that effectively would
be the same thing).
2006-11-14 08:45:48 +00:00
Matt Jacob
10365e5a68 Add 4Gb (24XX) support and lay the foundation for a lot of new stuff. 2006-11-02 03:21:32 +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