Whitespace cleanup.

This commit is contained in:
Matthew N. Dodd 2005-04-13 05:06:57 +00:00
parent 9cf4a5d55f
commit b1a9ec048e
5 changed files with 33 additions and 33 deletions

View File

@ -100,7 +100,7 @@ ida_free(struct ida_softc *ida)
free(ida->qcbs, M_DEVBUF); free(ida->qcbs, M_DEVBUF);
if (ida->ih != NULL) if (ida->ih != NULL)
bus_teardown_intr(ida->dev, ida->irq, ida->ih); bus_teardown_intr(ida->dev, ida->irq, ida->ih);
if (ida->irq != NULL) if (ida->irq != NULL)
bus_release_resource(ida->dev, ida->irq_res_type, bus_release_resource(ida->dev, ida->irq_res_type,
@ -118,12 +118,12 @@ ida_free(struct ida_softc *ida)
* record bus address from bus_dmamap_load * record bus address from bus_dmamap_load
*/ */
static void static void
ida_dma_map_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error) ida_dma_map_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error)
{ {
bus_addr_t *baddr; bus_addr_t *baddr;
baddr = (bus_addr_t *)arg; baddr = (bus_addr_t *)arg;
*baddr = segs->ds_addr; *baddr = segs->ds_addr;
} }
static __inline struct ida_qcb * static __inline struct ida_qcb *
@ -197,7 +197,7 @@ ida_init(struct ida_softc *ida)
SLIST_INIT(&ida->free_qcbs); SLIST_INIT(&ida->free_qcbs);
STAILQ_INIT(&ida->qcb_queue); STAILQ_INIT(&ida->qcb_queue);
bioq_init(&ida->bio_queue); bioq_init(&ida->bio_queue);
ida->qcbs = (struct ida_qcb *) ida->qcbs = (struct ida_qcb *)
malloc(IDA_QCB_MAX * sizeof(struct ida_qcb), M_DEVBUF, malloc(IDA_QCB_MAX * sizeof(struct ida_qcb), M_DEVBUF,
@ -226,7 +226,7 @@ ida_init(struct ida_softc *ida)
/* lockarg */ &Giant, /* lockarg */ &Giant,
&ida->hwqcb_dmat); &ida->hwqcb_dmat);
if (error) if (error)
return (ENOMEM); return (ENOMEM);
/* DMA tag for mapping buffers into device space */ /* DMA tag for mapping buffers into device space */
error = bus_dma_tag_create( error = bus_dma_tag_create(
@ -245,17 +245,17 @@ ida_init(struct ida_softc *ida)
/* lockarg */ &Giant, /* lockarg */ &Giant,
&ida->buffer_dmat); &ida->buffer_dmat);
if (error) if (error)
return (ENOMEM); return (ENOMEM);
/* Allocation of hardware QCBs */ /* Allocation of hardware QCBs */
/* XXX allocation is rounded to hardware page size */ /* XXX allocation is rounded to hardware page size */
error = bus_dmamem_alloc(ida->hwqcb_dmat, error = bus_dmamem_alloc(ida->hwqcb_dmat,
(void **)&ida->hwqcbs, BUS_DMA_NOWAIT, &ida->hwqcb_dmamap); (void **)&ida->hwqcbs, BUS_DMA_NOWAIT, &ida->hwqcb_dmamap);
if (error) if (error)
return (ENOMEM); return (ENOMEM);
/* And permanently map them in */ /* And permanently map them in */
bus_dmamap_load(ida->hwqcb_dmat, ida->hwqcb_dmamap, bus_dmamap_load(ida->hwqcb_dmat, ida->hwqcb_dmamap,
ida->hwqcbs, IDA_QCB_MAX * sizeof(struct ida_hardware_qcb), ida->hwqcbs, IDA_QCB_MAX * sizeof(struct ida_hardware_qcb),
ida_dma_map_cb, &ida->hwqcb_busaddr, /*flags*/0); ida_dma_map_cb, &ida->hwqcb_busaddr, /*flags*/0);
@ -318,11 +318,11 @@ ida_detach(device_t dev)
struct ida_softc *ida; struct ida_softc *ida;
int error = 0; int error = 0;
ida = (struct ida_softc *)device_get_softc(dev); ida = (struct ida_softc *)device_get_softc(dev);
/* /*
* XXX * XXX
* before detaching, we must make sure that the system is * before detaching, we must make sure that the system is
* quiescent; nothing mounted, no pending activity. * quiescent; nothing mounted, no pending activity.
*/ */
@ -343,7 +343,7 @@ ida_setup_dmamap(void *arg, bus_dma_segment_t *segs, int nsegments, int error)
struct ida_hardware_qcb *hwqcb = (struct ida_hardware_qcb *)arg; struct ida_hardware_qcb *hwqcb = (struct ida_hardware_qcb *)arg;
int i; int i;
hwqcb->hdr.size = htole16((sizeof(struct ida_req) + hwqcb->hdr.size = htole16((sizeof(struct ida_req) +
sizeof(struct ida_sgb) * IDA_NSEG) >> 2); sizeof(struct ida_sgb) * IDA_NSEG) >> 2);
for (i = 0; i < nsegments; i++) { for (i = 0; i < nsegments; i++) {
@ -402,8 +402,8 @@ ida_command(struct ida_softc *ida, int command, void *data, int datasize,
void void
ida_submit_buf(struct ida_softc *ida, struct bio *bp) ida_submit_buf(struct ida_softc *ida, struct bio *bp)
{ {
bioq_insert_tail(&ida->bio_queue, bp); bioq_insert_tail(&ida->bio_queue, bp);
ida_construct_qcb(ida); ida_construct_qcb(ida);
ida_start(ida); ida_start(ida);
} }

View File

@ -102,7 +102,7 @@ ida_v1_done(struct ida_softc *ida)
ida_outb(ida, R_EISA_LOCAL_DOORBELL, EISA_CHANNEL_CLEAR); ida_outb(ida, R_EISA_LOCAL_DOORBELL, EISA_CHANNEL_CLEAR);
if (completed != 0) { if (completed != 0) {
hwqcb = (struct ida_hardware_qcb *) hwqcb = (struct ida_hardware_qcb *)
((bus_addr_t)ida->hwqcbs + ((bus_addr_t)ida->hwqcbs +
((completed & ~3) - ida->hwqcb_busaddr)); ((completed & ~3) - ida->hwqcb_busaddr));
hwqcb->req.error = status; hwqcb->req.error = status;
@ -264,7 +264,7 @@ ida_eisa_probe(device_t dev)
eisa_add_iospace(dev, (io_base + IDA_EISA_IOPORT_START), eisa_add_iospace(dev, (io_base + IDA_EISA_IOPORT_START),
IDA_EISA_IOPORT_LEN, RESVADDR_NONE); IDA_EISA_IOPORT_LEN, RESVADDR_NONE);
eisa_add_intr(dev, irq, EISA_TRIGGER_LEVEL); /* XXX ??? */ eisa_add_intr(dev, irq, EISA_TRIGGER_LEVEL); /* XXX ??? */
return (0); return (0);
} }

View File

@ -249,7 +249,7 @@ ida_pci_attach(device_t dev)
* it appears that this board only does MEMIO access. * it appears that this board only does MEMIO access.
*/ */
if ((command & PCIM_CMD_MEMEN) == 0) { if ((command & PCIM_CMD_MEMEN) == 0) {
device_printf(dev, "Only memory mapped I/O is supported\n"); device_printf(dev, "Only memory mapped I/O is supported\n");
return (ENXIO); return (ENXIO);
} }
@ -292,13 +292,13 @@ ida_pci_attach(device_t dev)
} }
rid = 0; rid = 0;
ida->irq_res_type = SYS_RES_IRQ; ida->irq_res_type = SYS_RES_IRQ;
ida->irq = bus_alloc_resource_any(dev, ida->irq_res_type, &rid, ida->irq = bus_alloc_resource_any(dev, ida->irq_res_type, &rid,
RF_ACTIVE | RF_SHAREABLE); RF_ACTIVE | RF_SHAREABLE);
if (ida->irq == NULL) { if (ida->irq == NULL) {
ida_free(ida); ida_free(ida);
return (ENOMEM); return (ENOMEM);
} }
error = bus_setup_intr(dev, ida->irq, INTR_TYPE_BIO | INTR_ENTROPY, error = bus_setup_intr(dev, ida->irq, INTR_TYPE_BIO | INTR_ENTROPY,
ida_intr, ida, &ida->ih); ida_intr, ida, &ida->ih);
if (error) { if (error) {
@ -309,9 +309,9 @@ ida_pci_attach(device_t dev)
error = ida_init(ida); error = ida_init(ida);
if (error) { if (error) {
ida_free(ida); ida_free(ida);
return (error); return (error);
} }
ida_attach(ida); ida_attach(ida);
ida->flags |= IDA_ATTACHED; ida->flags |= IDA_ATTACHED;

View File

@ -86,7 +86,7 @@
#define CMD_REJECTED 0x14 #define CMD_REJECTED 0x14
/* /*
* command types * command types
*/ */
#define CMD_GET_LOG_DRV_INFO 0x10 /* Identify controller */ #define CMD_GET_LOG_DRV_INFO 0x10 /* Identify controller */
#define CMD_GET_CTRL_INFO 0x11 /* Identify logical driver */ #define CMD_GET_CTRL_INFO 0x11 /* Identify logical driver */
@ -211,7 +211,7 @@ struct ida_controller_info {
u_int8_t reserved[403]; u_int8_t reserved[403];
} __packed; } __packed;
/* /*
* CMD_SENSE_DRV_STATUS (0x12) * CMD_SENSE_DRV_STATUS (0x12)
* Sense logical drive status * Sense logical drive status
*/ */

View File

@ -77,7 +77,7 @@ struct ida_hardware_qcb {
struct ida_hdr hdr; /* 4 */ struct ida_hdr hdr; /* 4 */
struct ida_req req; /* 12 */ struct ida_req req; /* 12 */
struct ida_sgb seg[IDA_NSEG]; /* 256 */ struct ida_sgb seg[IDA_NSEG]; /* 256 */
struct ida_qcb *qcb; /* 4 - qcb backpointer */ struct ida_qcb *qcb; /* 4 - qcb backpointer */
}; };
typedef enum { typedef enum {
@ -117,7 +117,7 @@ struct ida_access {
}; };
/* /*
* flags for the controller * flags for the controller
*/ */
#define IDA_ATTACHED 0x01 /* attached */ #define IDA_ATTACHED 0x01 /* attached */
#define IDA_FIRMWARE 0x02 /* firmware must be started */ #define IDA_FIRMWARE 0x02 /* firmware must be started */
@ -197,7 +197,7 @@ extern struct ida_softc *ida_alloc(device_t dev, struct resource *regs,
int regs_type, int regs_id, bus_dma_tag_t parent_dmat); int regs_type, int regs_id, bus_dma_tag_t parent_dmat);
extern void ida_free(struct ida_softc *ida); extern void ida_free(struct ida_softc *ida);
extern int ida_init(struct ida_softc *ida); extern int ida_init(struct ida_softc *ida);
extern void ida_attach(struct ida_softc *ida); extern void ida_attach(struct ida_softc *ida);
extern int ida_command(struct ida_softc *ida, int command, void *data, extern int ida_command(struct ida_softc *ida, int command, void *data,
int datasize, int drive, u_int32_t pblkno, int flags); int datasize, int drive, u_int32_t pblkno, int flags);
extern void ida_submit_buf(struct ida_softc *ida, struct bio *bp); extern void ida_submit_buf(struct ida_softc *ida, struct bio *bp);