Commit Graph

23 Commits

Author SHA1 Message Date
Poul-Henning Kamp
fe12f24bb0 Add missing <sys/module.h> includes 2004-05-30 20:08:47 +00:00
Olivier Houchard
b14ec32eb0 Call trm_Interrupt() in trm_poll(). This fixes the lock at reboot time some
people reported.

PR:		kern/62864
Tested by:	Putinas Piliponis <putinas.piliponis at icnspot.net>
2004-04-10 15:38:49 +00:00
Nate Lawson
5f96beb9e0 Convert callers to the new bus_alloc_resource_any(9) API.
Submitted by:	Mark Santcroos <marks@ripe.net>
Reviewed by:	imp, dfr, bde
2004-03-17 17:50:55 +00:00
Olivier Houchard
7ff7c6b9ad Use one bus_dma_tag_t for all pSRB instead of creating one for each.
Free what is allocated for pSRBs at unload time or if something bad happens,
thanks to scottl for spotting this out.
2004-03-07 17:23:39 +00:00
Olivier Houchard
fdf2a3468a Do not test if pDCB is not NULL, we dereference it before anyway, and it
should not happen. Add a KASSERT instead.

Reported by:	Ted Unangst <tedu@coverity.com>
Spotted out by:	cperciva
2004-02-20 20:36:55 +00:00
Olivier Houchard
63bfa8ba2c Remove duplicate __FBSDID().
Mark trm as depending on cam.
2004-01-09 23:30:31 +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
90cf0136c4 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 07:08:17 +00:00
Maxime Henrion
9bc72abc30 Remove two useless bzero() calls.
Reviewed by:	cognet
2003-08-12 14:51:18 +00:00
Scott Long
588920f14e Call bus_dmamap_create() to create the per-SRB buffer maps. Note that none
of the SRB resources are freed when the driver unloads; maybe that will be
tackled another day.
2003-08-09 15:16:45 +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
Olivier Houchard
995df2fc9f Fix some style bugs. 2003-06-25 13:33:41 +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
Poul-Henning Kamp
b2bf0c7f48 Fix indentation.
Found by:       FlexeLint
2003-05-31 19:38:00 +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
Olivier Houchard
f5ca18bc8c Merge diff between rev 1.08 and rev 1.11 of Tekram driver, this notably add
support for Tekram DC395U2W cards.
Add a fix submitted by joerg@ to correctly report some errors to CAM.
Use bus_dma instead of the remaining vtophys().
2003-02-20 03:21:34 +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
Olivier Houchard
1dbb2b5ac0 Fix the panic that occurs when kldunloading trm by using the correct
prototype for trm_detach and freeing all resources.
While I'm there, handle better errors in trm_attach and remove the
PCI_BASE_ADDR0 definition, since it's what PCIR_MAPS is used for.

MFC after:	3 days
2002-12-16 13:38:22 +00:00
Olivier Houchard
26532c3696 Remove the remaining calls to free(), they are not needed anymore now
device_get_softc() is used.
2002-11-14 19:54:33 +00:00
Olivier Houchard
d6ca3de751 Import of the trm(4) driver (for Tekram DC395U/UW/F and DC315U SCSI adapters).
Reviewed by:	mux, scottl
Approved by:	mux, scottl
2002-10-13 18:32:39 +00:00