summaryrefslogtreecommitdiffstats
path: root/sys/dev/firewire/fwohci.c
diff options
context:
space:
mode:
authorsimokawa <simokawa@FreeBSD.org>2004-03-26 23:17:10 +0000
committersimokawa <simokawa@FreeBSD.org>2004-03-26 23:17:10 +0000
commit3e9f33ddfa8ae2d049f8e827244fdb7ee5f13790 (patch)
treed9df20a1b244e854f2dbc94fb002b9471a60e817 /sys/dev/firewire/fwohci.c
parentd5e8f62700d6cc71bdc98dcce5c75443c6b4a22b (diff)
downloadFreeBSD-src-3e9f33ddfa8ae2d049f8e827244fdb7ee5f13790.zip
FreeBSD-src-3e9f33ddfa8ae2d049f8e827244fdb7ee5f13790.tar.gz
MFp4: FireWire
* all - s/__FUNCTION__/__func__/. Submitted by: Stefan Farfeleder <stefan@fafoe.narf.at> - Compatibility for RELENG_4 and DragonFly. * firewire - Timestamp just before queuing. - Retry bus probe if it fails. - Use device_printf() for debug message. - Invalidiate CROM while update. - Don't process minimum/invalid CROM. * sbp - Add ORB_SHORTAGE flag. - Add sbp.tags tunable. - Revive doorbell support. It's not enabled by default.
Diffstat (limited to 'sys/dev/firewire/fwohci.c')
-rw-r--r--sys/dev/firewire/fwohci.c35
1 files changed, 22 insertions, 13 deletions
diff --git a/sys/dev/firewire/fwohci.c b/sys/dev/firewire/fwohci.c
index 147285e..afc58d5 100644
--- a/sys/dev/firewire/fwohci.c
+++ b/sys/dev/firewire/fwohci.c
@@ -54,16 +54,25 @@
#include <machine/bus.h>
-#if __FreeBSD_version < 500000
+#if defined(__DragonFly__) || __FreeBSD_version < 500000
#include <machine/clock.h> /* for DELAY() */
#endif
+#ifdef __DragonFly__
+#include "firewire.h"
+#include "firewirereg.h"
+#include "fwdma.h"
+#include "fwohcireg.h"
+#include "fwohcivar.h"
+#include "firewire_phy.h"
+#else
#include <dev/firewire/firewire.h>
#include <dev/firewire/firewirereg.h>
#include <dev/firewire/fwdma.h>
#include <dev/firewire/fwohcireg.h>
#include <dev/firewire/fwohcivar.h>
#include <dev/firewire/firewire_phy.h>
+#endif
#undef OHCI_DEBUG
@@ -1206,7 +1215,7 @@ fwohci_db_init(struct fwohci_softc *sc, struct fwohci_dbch *dbch)
/*nsegments*/ dbch->ndesc > 3 ? dbch->ndesc - 2 : 1,
/*maxsegsz*/ MAX_REQCOUNT,
/*flags*/ 0,
-#if __FreeBSD_version >= 501102
+#if defined(__FreeBSD__) && __FreeBSD_version >= 501102
/*lockfunc*/busdma_lock_mutex,
/*lockarg*/&Giant,
#endif
@@ -1814,11 +1823,11 @@ busresetout:
#ifndef ACK_ALL
OWRITE(sc, FWOHCI_INTSTATCLR, OHCI_INT_DMA_IR);
#endif
-#if __FreeBSD_version >= 500000
- irstat = atomic_readandclear_int(&sc->irstat);
-#else
+#if defined(__DragonFly__) || __FreeBSD_version < 500000
irstat = sc->irstat;
sc->irstat = 0;
+#else
+ irstat = atomic_readandclear_int(&sc->irstat);
#endif
for(i = 0; i < fc->nisodma ; i++){
struct fwohci_dbch *dbch;
@@ -1838,11 +1847,11 @@ busresetout:
#ifndef ACK_ALL
OWRITE(sc, FWOHCI_INTSTATCLR, OHCI_INT_DMA_IT);
#endif
-#if __FreeBSD_version >= 500000
- itstat = atomic_readandclear_int(&sc->itstat);
-#else
+#if defined(__DragonFly__) || __FreeBSD_version < 500000
itstat = sc->itstat;
sc->itstat = 0;
+#else
+ itstat = atomic_readandclear_int(&sc->itstat);
#endif
for(i = 0; i < fc->nisodma ; i++){
if((itstat & (1 << i)) != 0){
@@ -1928,7 +1937,7 @@ busresetout:
}
for (i = 0; i < plen / 4; i ++)
buf[i] = FWOHCI_DMA_READ(sc->sid_buf[i+1]);
-#if 1
+#if 1 /* XXX needed?? */
/* pending all pre-bus_reset packets */
fwohci_txd(sc, &sc->atrq);
fwohci_txd(sc, &sc->atrs);
@@ -2355,12 +2364,12 @@ print_db(struct fwohcidb_tr *db_tr, struct fwohcidb *db,
res = FWOHCI_DMA_READ(db[i].db.desc.res);
key = cmd & OHCI_KEY_MASK;
stat = res >> OHCI_STATUS_SHIFT;
-#if __FreeBSD_version >= 500000
- printf("%08jx %s %s %s %s %5d %08x %08x %04x:%04x",
- (uintmax_t)db_tr->bus_addr,
-#else
+#if defined(__DragonFly__) || __FreeBSD_version < 500000
printf("%08x %s %s %s %s %5d %08x %08x %04x:%04x",
db_tr->bus_addr,
+#else
+ printf("%08jx %s %s %s %s %5d %08x %08x %04x:%04x",
+ (uintmax_t)db_tr->bus_addr,
#endif
dbcode[(cmd >> 28) & 0xf],
dbkey[(cmd >> 24) & 0x7],
OpenPOWER on IntegriCloud