Commit Graph

30 Commits

Author SHA1 Message Date
Peter Wemm
a89ec05e3e Catch a few places where NULL (pointer) was used where 0 (integer) was
expected.
2003-12-23 02:36:43 +00:00
John Baldwin
e27951b29c Use PCIR_BAR(x) instead of PCIR_MAPS.
Glanced over by:	imp, gibbs
Tested by:		i386 LINT
2003-09-02 17:30:40 +00:00
David E. O'Brien
aad970f1fe Use __FBSDID().
Also some minor style cleanups.
2003-08-24 17:55:58 +00:00
Warner Losh
38d8c9940b 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.
2003-08-22 06:42:59 +00:00
Scott Long
f6b1c44d1f 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
2003-07-01 15:52:06 +00:00
Nate Lawson
2813692cc2 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
2003-06-14 22:17:41 +00:00
Matt Jacob
a96c0ef246 Add change that allows PAE to work.
Submitted by:	Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
2003-06-12 17:10:00 +00:00
Matt Jacob
7fed69ee80 Update MPILIB from code received from LSI. Make changes in the rest of
the driver based upon some somewhat gratuitous name changes.
2003-06-03 17:47:48 +00:00
John Baldwin
6705889407 Fix compile: the type is spelled bus_dmasync_op_t rather than
bus_dmamap_sync_t.

With hat:	re
2003-05-27 18:32:24 +00:00
Scott Long
7e71df9339 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)
2003-05-27 04:59:59 +00:00
Maxime Henrion
7a648f56cf I deserve a big pointy hat for having missed all those references
to bus_dmasync_op_t in my last commit.
2003-04-10 23:50:06 +00:00
David E. O'Brien
cc2f8c60cd PAGE_SIZE is unsigned on all our platforms, and is a long on some.
So cast to u_long before printing out and use a matching specifier.

Tested on:	sparc64
2003-02-23 19:49:30 +00:00
Warner Losh
a163d034fa Back out M_* changes, per decision of the TRB.
Approved by: trb
2003-02-19 05:47:46 +00:00
Alfred Perlstein
44956c9863 Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
2003-01-21 08:56:16 +00:00
Poul-Henning Kamp
031fd299d7 Be consistent about functions being static.
Spotted by:	FlexeLint.
2002-10-16 08:48:39 +00:00
Matt Jacob
301472c20b Code cleanup: use mpt_prt instead of device_printf. 2002-09-24 21:33:43 +00:00
Matt Jacob
7dec90bcf9 Parameterize MPT_MAX_REQUESTS based upon device type (FC has Global Credits
of 1024- Ultra4 256). Rename 'requests' tag to 'request_pool' for clarity.
Make sure we do correct xpt_freeze_simq/CAM_RELEASE_SIMQ if we run out
of chip resources.

MFC after:	6 days
2002-09-23 19:41:10 +00:00
Matt Jacob
77e22cb706 Wads more cleanup...
In mpttimeout, call mpt_intr just on the offchance that we missed
an interrupt. We can check to see whether or not the command that
is timing out got completed.

When we *do* decide to timeout a command, set the command state to
REQ_TIMEOUT and then invoke another timeout (hz/10)- mpttimeout2.
This allows us to catch a couple cases we've seen where the command
we timed out on in fact is ready to be completed by the firmware.
In any case, it's only after mpttimeout2 is called that we actually
take down the private state and free the request itself. CAM has
been notified in mpttimeout anyway. This whole area should be redone,
but that will take 105% of my available game time for this month.

Fix a couple of missing (and not useful, at presnet) CAMLOCK_2_MPTLOCK
and MPTLOCK_2_CAMLOCK locations.

Split mpt_notify into mpt_ctlop, which handles all reply completions
that have 0x800000000 or'd into the ContextID. This function can, in
fact, call mpt_event_notify_reply, which handles the traditional
async event notifications. While we're at it, put in the extremely
important (but currently untested) code that send back an Ack to
an Event Notification (if the Event Notification is marked with
AckRequired). Note that an Ack also generates another ctlop completion,
tra la.

Fix up mpt_done substantially to try and get how we plug into CAM
correctly done. Remove bogus CAM_RELEASE_SIMQ settings.

Do some cleanups in mpt_action that are related to speed negotiation
for Ultra4 cards. This is an area that is still quite fragile and
worrisome as config data being read back often doesn't make sense or
jibe with the documentation.

At any rate, after these changes were done, I was finally able to
get Lars Eggert's dual 320M disk system to stay up under load all
weekend- hopefully we're in good enough for now shape.

MFC after:	1 week
2002-09-23 05:25:59 +00:00
Matt Jacob
aca01e3897 Recognize the single channel 2Gb card (FC919)- thanks to LSI Logic for
pointing this out.

In mpt_intr, don't try and pop a reply queue element out *unless*
the interrupt status says you might have one.

MFC after:	1 week
2002-09-23 05:16:00 +00:00
Matt Jacob
daa46fadd9 We do not need to expose mpt_notify outside of mpt_freebsd.c.
MFC after:	1 week
2002-09-23 05:14:38 +00:00
Matt Jacob
0424fb537e When freeing a request, zero out the sequence number.
Define the CFG_DAGA_OFF offset as 128 bytes instead of 40- gives us
a more reasonable headroom.

When reading a config page, zero out the entire request area- not just
the length of the request. This is because we cleverly (cheezily) return
configuration data back into the allocated request area, so it's nice
to make sure we start with a clean area to write on.

MFC after:	1 week
2002-09-23 05:14:02 +00:00
Matt Jacob
530d743a2f Don't do transition locking (i.e., CAM->MPT->CAM)- Peter claimed that ia64
chokes the chicken with this.

Submitted by:	wemm@freebsd.org
2002-09-03 02:18:21 +00:00
Matt Jacob
ce68dae5d6 Fix things so that:
a) we don't believe what the board tells us all the time (if the BIOS
hasn't run, port page 2 and port page 0 tend to be garbage)

b) add the missing code to set parameters for the SPI cards.

MFC after:	0 days
2002-09-01 23:07:09 +00:00
Matt Jacob
d3ecac6617 Sigh. Ken Merry convinced me that my attempts to DTRT were wrong.
Replace dual copyright with a plain BSD style copyright assigned
to LSI Logic. This is still within the intents of express consent
from LSI.

MFC after:	2 days
2002-08-30 03:36:50 +00:00
Matt Jacob
eae4a35f9f Add 909A PCI id.
MFC after:	2 days
2002-08-30 02:35:31 +00:00
Matt Jacob
8d4ee0ece1 Add an additional copyright (with the express consent of LSI Logic) that
specifically allows for (via 'BSD Style' licensing) source && binary
redistribution.

Pointy hat to: Matt, for not getting this done ahead of time.

MFC after: 2 days
2002-08-30 02:34:19 +00:00
Matt Jacob
90f62fd23f Do some minor cleanups found during backport to RELENG_4. 2002-08-23 06:56:31 +00:00
Matt Jacob
019717e053 Pick a cleaner method (and put in a separate function) for finding
the peer device on a dual board.
2002-08-23 06:56:08 +00:00
Matt Jacob
7104aeef01 A chunk of cleanup, both stylistic and substantive.
We now also read configuration information for the SCSI cards- this allows
us to try and say what the speed settings now are.

Start, but not yet complete, the process of reorgs && #defines so that we
can backport to RELENG_4 pretty soon.
2002-08-20 23:04:08 +00:00
Matt Jacob
9b63136347 Add support for the LSI-Logic Fusion/MP architecture.
This is an architecture that present a thing message passing interface
to the OS. You can query as to how many ports and what kind are attached
and enable them and so on.

A less grand view is that this is just another way to package SCSI (SPI or
FC) and FC-IP into a one-driver interface set.

This driver support the following hardware:

LSI FC909:	Single channel, 1Gbps, Fibre Channel (FC-SCSI only)
LSI FC929:	Dual Channel, 1-2Gbps, Fibre Channel (FC-SCSI only)
LSI 53c1020:	Single Channel, Ultra4 (320M) (Untested)
LSI 53c1030:	Dual Channel, Ultra4 (320M)

Currently it's in fair shape, but expect a lot of changes over the
next few weeks as it stabilizes.

Credits:

The driver is mostly from some folks from Jeff Roberson's company- I've
been slowly migrating it to broader support that I it came to me as.

The hardware used in developing support came from:

	FC909: LSI-Logic, Advansys (now Connetix)
	FC929: LSI-Logic
	53c1030: Antares Microsystems (they make a very fine board!)

MFC after:	3 weeks
2002-08-11 23:34:20 +00:00