diff options
author | Marco Peereboom <marco@cvs.openbsd.org> | 2007-09-06 14:19:39 +0000 |
---|---|---|
committer | Marco Peereboom <marco@cvs.openbsd.org> | 2007-09-06 14:19:39 +0000 |
commit | e979741369bd50f2904c73d1c1a652a49928f6ef (patch) | |
tree | a461f8ae599521fa7f701069ed17775824899989 /sys/dev/pci | |
parent | 2705b9853aacf3e7df83453bcb6785d938db4cee (diff) |
Shuffle some things around to get rid of #ifdev's
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/qli_pci.c | 79 |
1 files changed, 37 insertions, 42 deletions
diff --git a/sys/dev/pci/qli_pci.c b/sys/dev/pci/qli_pci.c index 0d5508dbdb9..d5c93c34182 100644 --- a/sys/dev/pci/qli_pci.c +++ b/sys/dev/pci/qli_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qli_pci.c,v 1.6 2007/09/06 03:55:19 davec Exp $ */ +/* $OpenBSD: qli_pci.c,v 1.7 2007/09/06 14:19:38 marco Exp $ */ /* * Copyright (c) 2007 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2007 David Collins <dave@davec.name> @@ -46,8 +46,36 @@ #define DEVNAME(_s) ((_s)->sc_dev.dv_xname) +struct qli_softc { + struct device sc_dev; + + void *sc_ih; + bus_space_tag_t sc_memt; + bus_space_handle_t sc_memh; + bus_size_t sc_memsize; + bus_dma_tag_t sc_dmat; + + volatile struct qli_reg *sc_reg; /* pointer to registers */ + + /* scsi ioctl from sd device */ + int (*sc_ioctl)(struct device *, u_long, caddr_t); + + int sc_ql4010; /* if set we are a QL4010 HBA */ + u_int32_t sc_resource; /* nr for semaphores */ + + struct rwlock sc_lock; + + /* mailbox members */ + struct rwlock sc_mbox_lock; + u_int32_t sc_mbox[QLI_MBOX_SIZE]; + int sc_mbox_flags; +#define QLI_MBOX_F_INVALID (0x00) +#define QLI_MBOX_F_PENDING (0x01) +#define QLI_MBOX_F_WAKEUP (0x02) +#define QLI_MBOX_F_POLL (0x04) +}; + /* #define QLI_DEBUG */ -#define QLI_DEBUG #ifdef QLI_DEBUG #define DPRINTF(x...) do { if (qli_debug) printf(x); } while(0) #define DNPRINTF(n,x...) do { if (qli_debug & n) printf(x); } while(0) @@ -61,13 +89,7 @@ #define QLI_D_CCB 0x0080 #define QLI_D_SEM 0x0100 #define QLI_D_MBOX 0x0200 -#else -#define DPRINTF(x...) -#define DNPRINTF(n,x...) -#define qli_dump_mbox(x, y) -#endif -#ifdef QLI_DEBUG u_int32_t qli_debug = 0 | QLI_D_CMD | QLI_D_INTR @@ -80,7 +102,13 @@ u_int32_t qli_debug = 0 | QLI_D_SEM | QLI_D_MBOX ; -#endif + +void qli_dump_mbox(struct qli_softc *, u_int32_t *); +#else +#define DPRINTF(x...) +#define DNPRINTF(n,x...) +#define qli_dump_mbox(x, y) +#endif /* QLI_DEBUG */ struct qli_mem { bus_dmamap_t am_map; @@ -93,35 +121,6 @@ struct qli_mem { #define QLIMEM_DVA(_am) ((_am)->am_map->dm_segs[0].ds_addr) #define QLIMEM_KVA(_am) ((void *)(_am)->am_kva) -struct qli_softc { - struct device sc_dev; - - void *sc_ih; - bus_space_tag_t sc_memt; - bus_space_handle_t sc_memh; - bus_size_t sc_memsize; - bus_dma_tag_t sc_dmat; - - volatile struct qli_reg *sc_reg; /* pointer to registers */ - - /* scsi ioctl from sd device */ - int (*sc_ioctl)(struct device *, u_long, caddr_t); - - int sc_ql4010; /* if set we are a QL4010 HBA */ - u_int32_t sc_resource; /* nr for semaphores */ - - struct rwlock sc_lock; - - /* mailbox members */ - struct rwlock sc_mbox_lock; - u_int32_t sc_mbox[QLI_MBOX_SIZE]; - int sc_mbox_flags; -#define QLI_MBOX_F_INVALID (0x00) -#define QLI_MBOX_F_PENDING (0x01) -#define QLI_MBOX_F_WAKEUP (0x02) -#define QLI_MBOX_F_POLL (0x04) -}; - struct qli_mem *qli_allocmem(struct qli_softc *, size_t); void qli_freemem(struct qli_softc *, struct qli_mem *); int qli_scsi_cmd(struct scsi_xfer *); @@ -153,10 +152,6 @@ int qli_attach(struct qli_softc *); int qli_create_sensors(struct qli_softc *); #endif /* SMALL_KERNEL */ -#ifdef QLI_DEBUG -void qli_dump_mbox(struct qli_softc *, u_int32_t *); -#endif /* QLI_DEBUG */ - struct scsi_adapter qli_switch = { qli_scsi_cmd, qliminphys, 0, 0, qli_scsi_ioctl }; |