Permalink
Browse files

kernel/firewire: Remove #ifdef __DragonFly__ jungle.

  • Loading branch information...
1 parent 866fc57 commit c6068303921ad501482a0543881882e828a9e4fa Sascha Wildner committed Feb 8, 2013
View
27 sys/bus/firewire/firewire.c
@@ -45,23 +45,11 @@
#include <sys/sysctl.h>
#include <sys/thread2.h>
-#if defined(__DragonFly__) || __FreeBSD_version < 500000
-#include <machine/clock.h> /* for DELAY() */
-#endif
-
-#ifdef __DragonFly__
-#include "firewire.h"
-#include "firewirereg.h"
-#include "fwmem.h"
-#include "iec13213.h"
-#include "iec68113.h"
-#else
-#include <dev/firewire/firewire.h>
-#include <dev/firewire/firewirereg.h>
-#include <dev/firewire/fwmem.h>
-#include <dev/firewire/iec13213.h>
-#include <dev/firewire/iec68113.h>
-#endif
+#include <bus/firewire/firewire.h>
+#include <bus/firewire/firewirereg.h>
+#include <bus/firewire/fwmem.h>
+#include <bus/firewire/iec13213.h>
+#include <bus/firewire/iec68113.h>
struct crom_src_buf {
struct crom_src src;
@@ -633,13 +621,8 @@ fw_reset_crom(struct firewire_comm *fc)
crom_add_entry(root, CSRKEY_NCAP, 0x0083c0); /* XXX */
/* private company_id */
crom_add_entry(root, CSRKEY_VENDOR, CSRVAL_VENDOR_PRIVATE);
-#ifdef __DragonFly__
crom_add_simple_text(src, root, &buf->vendor, "DragonFly Project");
crom_add_entry(root, CSRKEY_HW, __DragonFly_version);
-#else
- crom_add_simple_text(src, root, &buf->vendor, "FreeBSD Project");
- crom_add_entry(root, CSRKEY_HW, __FreeBSD_version);
-#endif
crom_add_simple_text(src, root, &buf->hw, hostname);
}
View
4 sys/bus/firewire/firewire.h
@@ -32,8 +32,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* $FreeBSD: src/sys/dev/firewire/firewire.h,v 1.17 2003/11/07 09:01:41 simokawa Exp $
- * $DragonFly: src/sys/bus/firewire/firewire.h,v 1.5 2004/05/19 22:52:38 dillon Exp $
- *
*/
#ifndef _FIREWIRE_H
@@ -414,10 +412,8 @@ struct fw_crom_buf {
#define FWMAXNDMA 0x100 /* 8 bits DMA channel id. in device No. */
-#if defined(__DragonFly__) || __FreeBSD_version < 500000
#define dev2unit(x) ((minor(x) & 0xff) | (minor(x) >> 8))
#define unit2minor(x) (((x) & 0xff) | (((x) << 8) & ~0xffff))
-#endif
#define MAKEMINOR(f, u, s) \
unit2minor((f) | (((u) & 0xff) << 8) | (s & 0xff))
View
21 sys/bus/firewire/firewirereg.h
@@ -32,17 +32,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* $FreeBSD: src/sys/dev/firewire/firewirereg.h,v 1.33 2004/01/06 14:30:46 simokawa Exp $
- * $DragonFly: src/sys/bus/firewire/firewirereg.h,v 1.12 2006/09/10 01:26:32 dillon Exp $
- *
*/
-#ifdef __DragonFly__
-typedef struct thread fw_proc;
-#elif __FreeBSD_version >= 500000
typedef struct thread fw_proc;
-#else
-typedef struct proc fw_proc;
-#endif
#include <sys/uio.h>
#include <sys/event.h>
@@ -307,22 +299,9 @@ void fwdev_clone (void *, char *, int, cdev_t *);
extern int firewire_debug;
extern devclass_t firewire_devclass;
-#ifdef __DragonFly__
#define FWPRI PCATCH
-#else
-#define FWPRI ((PZERO+8)|PCATCH)
-#endif
-#if defined(__DragonFly__) || __FreeBSD_version < 500000
#define CALLOUT_INIT(x) callout_init(x)
-#else
-#define CALLOUT_INIT(x) callout_init(x, 0 /* mpsafe */)
-#endif
-
-#if defined(__DragonFly__)
-#define MIN(a,b) (((a)<(b))?(a):(b))
-#define MAX(a,b) (((a)>(b))?(a):(b))
-#endif
MALLOC_DECLARE(M_FW);
MALLOC_DECLARE(M_FWXFER);
View
19 sys/bus/firewire/fwcrom.c
@@ -52,13 +52,8 @@
#define kprintf printf
#endif
-#ifdef __DragonFly__
-#include "firewire.h"
-#include "iec13213.h"
-#else
-#include <dev/firewire/firewire.h>
-#include <dev/firewire/iec13213.h>
-#endif
+#include <bus/firewire/firewire.h>
+#include <bus/firewire/iec13213.h>
#define MAX_ROM (1024 - sizeof(u_int32_t) * 5)
#define CROM_END(cc) ((vm_offset_t)(cc)->stack[0].dir + MAX_ROM - 1)
@@ -455,11 +450,7 @@ crom_add_simple_text(struct crom_src *src, struct crom_chunk *parent,
len = strlen(buf);
if (len > MAX_TEXT) {
-#if defined(__DragonFly__) || __FreeBSD_version < 500000
kprintf("text(%d) truncated to %lu.\n", len, (u_long)MAX_TEXT);
-#else
- kprintf("text(%d) truncated to %td.\n", len, MAX_TEXT);
-#endif
len = MAX_TEXT;
}
@@ -594,15 +585,9 @@ main(int argc, char *argv[])
/* private company_id */
crom_add_entry(&root, CSRKEY_VENDOR, 0xacde48);
-#ifdef __DragonFly__
crom_add_simple_text(&src, &root, &text1, "DragonFly");
crom_add_entry(&root, CSRKEY_HW, __DragonFly_version);
crom_add_simple_text(&src, &root, &text2, "DragonFly-1");
-#else
- crom_add_simple_text(&src, &root, &text1, "FreeBSD");
- crom_add_entry(&root, CSRKEY_HW, __FreeBSD_version);
- crom_add_simple_text(&src, &root, &text2, "FreeBSD-5");
-#endif
/* SBP unit directory */
crom_add_chunk(&src, &root, &unit1, CROM_UDIR);
View
22 sys/bus/firewire/fwdev.c
@@ -39,11 +39,7 @@
#include <sys/systm.h>
#include <sys/types.h>
#include <sys/mbuf.h>
-#if defined(__DragonFly__) || __FreeBSD_version < 500000
#include <sys/buf.h>
-#else
-#include <sys/bio.h>
-#endif
#include <sys/kernel.h>
#include <sys/malloc.h>
@@ -55,19 +51,11 @@
#include <sys/thread2.h>
-#ifdef __DragonFly__
-#include "firewire.h"
-#include "firewirereg.h"
-#include "fwdma.h"
-#include "fwmem.h"
-#include "iec68113.h"
-#else
-#include <dev/firewire/firewire.h>
-#include <dev/firewire/firewirereg.h>
-#include <dev/firewire/fwdma.h>
-#include <dev/firewire/fwmem.h>
-#include <dev/firewire/iec68113.h>
-#endif
+#include <bus/firewire/firewire.h>
+#include <bus/firewire/firewirereg.h>
+#include <bus/firewire/fwdma.h>
+#include <bus/firewire/fwmem.h>
+#include <bus/firewire/iec68113.h>
#define FWNODE_INVAL 0xffff
View
12 sys/bus/firewire/fwdma.c
@@ -46,15 +46,9 @@
#include <sys/mutex.h>
#endif
-#ifdef __DragonFly__
#include <bus/firewire/firewire.h>
#include <bus/firewire/firewirereg.h>
#include <bus/firewire/fwdma.h>
-#else
-#include <dev/firewire/firewire.h>
-#include <dev/firewire/firewirereg.h>
-#include <dev/firewire/fwdma.h>
-#endif
static void
fwdma_map_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error)
@@ -190,11 +184,7 @@ fwdma_malloc_multiseg(struct firewire_comm *fc, int alignment,
}
#if 0
-#if defined(__DragonFly__) || __FreeBSD_version < 500000
- kprintf("malloc_multi: ssize=%d nseg=%d\n", ssize, nseg);
-#else
- kprintf("malloc_multi: ssize=%td nseg=%d\n", ssize, nseg);
-#endif
+ kprintf("malloc_multi: ssize=%ld nseg=%d\n", ssize, nseg);
#endif
for (seg = &am->seg[0]; nseg --; seg ++) {
seg->v_addr = fwdma_malloc_size(am->dma_tag, &seg->dma_map,
View
16 sys/bus/firewire/fwmem.c
@@ -43,26 +43,16 @@
#include <sys/conf.h>
#include <sys/bus.h>
#include <sys/sysctl.h>
-#if defined(__DragonFly__) || __FreeBSD_version < 500000
#include <sys/buf.h>
-#else
-#include <sys/bio.h>
-#endif
#include <sys/signal.h>
#include <sys/mman.h>
#include <sys/fcntl.h>
#include <sys/thread2.h>
-#ifdef __DragonFly__
-#include "firewire.h"
-#include "firewirereg.h"
-#include "fwmem.h"
-#else
-#include <dev/firewire/firewire.h>
-#include <dev/firewire/firewirereg.h>
-#include <dev/firewire/fwmem.h>
-#endif
+#include <bus/firewire/firewire.h>
+#include <bus/firewire/firewirereg.h>
+#include <bus/firewire/fwmem.h>
static int fwmem_speed=2, fwmem_debug=0;
static struct fw_eui64 fwmem_eui64;
View
40 sys/bus/firewire/fwohci.c
@@ -55,25 +55,12 @@
#include <sys/thread2.h>
-#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
+#include <bus/firewire/firewire.h>
+#include <bus/firewire/firewirereg.h>
+#include <bus/firewire/fwdma.h>
+#include <bus/firewire/fwohcireg.h>
+#include <bus/firewire/fwohcivar.h>
+#include <bus/firewire/firewire_phy.h>
#undef OHCI_DEBUG
@@ -1817,12 +1804,7 @@ fwohci_intr_body(struct fwohci_softc *sc, u_int32_t stat, int count)
#ifndef ACK_ALL
OWRITE(sc, FWOHCI_INTSTATCLR, OHCI_INT_DMA_IR);
#endif
-#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;
@@ -1841,12 +1823,7 @@ fwohci_intr_body(struct fwohci_softc *sc, u_int32_t stat, int count)
#ifndef ACK_ALL
OWRITE(sc, FWOHCI_INTSTATCLR, OHCI_INT_DMA_IT);
#endif
-#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){
fwohci_tbuf_update(sc, i);
@@ -2372,13 +2349,8 @@ 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 defined(__DragonFly__) || __FreeBSD_version < 500000
- kprintf("%08x %s %s %s %s %5d %08lx %08lx %04x:%04x",
- (unsigned int)db_tr->bus_addr,
-#else
kprintf("%08jx %s %s %s %s %5d %08lx %08lx %04x:%04x",
(uintmax_t)db_tr->bus_addr,
-#endif
dbcode[(cmd >> 28) & 0xf],
dbkey[(cmd >> 24) & 0x7],
dbcond[(cmd >> 20) & 0x3],
View
34 sys/bus/firewire/fwohci_pci.c
@@ -51,36 +51,15 @@
#endif
#include <sys/thread2.h>
-#if defined(__DragonFly__) || __FreeBSD_version < 500000
-#include <machine/clock.h> /* for DELAY() */
-#endif
-
-#ifdef __DragonFly__
#include <bus/pci/pcivar.h>
#include <bus/pci/pcireg.h>
-#include "firewire.h"
-#include "firewirereg.h"
-
-#include "fwdma.h"
-#include "fwohcireg.h"
-#include "fwohcivar.h"
-#else
-#if __FreeBSD_version < 500000
-#include <pci/pcivar.h>
-#include <pci/pcireg.h>
-#else
-#include <dev/pci/pcivar.h>
-#include <dev/pci/pcireg.h>
-#endif
-
-#include <dev/firewire/firewire.h>
-#include <dev/firewire/firewirereg.h>
+#include <bus/firewire/firewire.h>
+#include <bus/firewire/firewirereg.h>
-#include <dev/firewire/fwdma.h>
-#include <dev/firewire/fwohcireg.h>
-#include <dev/firewire/fwohcivar.h>
-#endif
+#include <bus/firewire/fwdma.h>
+#include <bus/firewire/fwohcireg.h>
+#include <bus/firewire/fwohcivar.h>
static int fwohci_pci_attach(device_t self);
static int fwohci_pci_detach(device_t self);
@@ -272,8 +251,8 @@ fwohci_pci_attach(device_t self)
fwohci_softc_t *sc = device_get_softc(self);
int err;
int rid;
-#if defined(__DragonFly__) || __FreeBSD_version < 500000
int intr;
+
/* For the moment, put in a message stating what is wrong */
intr = pci_read_config(self, PCIR_INTLINE, 1);
if (intr == 0 || intr == 255) {
@@ -282,7 +261,6 @@ fwohci_pci_attach(device_t self)
device_printf(self, "Please switch PNP-OS to 'No' in BIOS\n");
#endif
}
-#endif
if (bootverbose)
firewire_debug = bootverbose;
View
6 sys/bus/firewire/fwohcivar.h
@@ -32,15 +32,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* $FreeBSD: src/sys/dev/firewire/fwohcivar.h,v 1.11 2004/01/06 14:30:47 simokawa Exp $
- * $DragonFly: src/sys/bus/firewire/fwohcivar.h,v 1.6 2005/11/17 21:29:45 dillon Exp $
- *
*/
-#if defined(__DragonFly__) || __FreeBSD_version < 500000
#define FWOHCI_TASKQUEUE 0
-#else
-#define FWOHCI_TASKQUEUE 1
-#endif
#if FWOHCI_TASKQUEUE
#include <sys/taskqueue.h>
#endif

0 comments on commit c606830

Please sign in to comment.