Module Name: src Committed By: jakllsch Date: Mon Apr 24 12:58:15 UTC 2017
Modified Files: src/sys/dev/ic: siisata.c Log Message: Drop unused prototype. Whitespace fixes. Wrap/re-wrap long lines. To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/sys/dev/ic/siisata.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/ic/siisata.c diff -u src/sys/dev/ic/siisata.c:1.30 src/sys/dev/ic/siisata.c:1.31 --- src/sys/dev/ic/siisata.c:1.30 Tue Jan 3 01:30:15 2017 +++ src/sys/dev/ic/siisata.c Mon Apr 24 12:58:15 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: siisata.c,v 1.30 2017/01/03 01:30:15 jakllsch Exp $ */ +/* $NetBSD: siisata.c,v 1.31 2017/04/24 12:58:15 jakllsch Exp $ */ /* from ahcisata_core.c */ @@ -79,7 +79,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.30 2017/01/03 01:30:15 jakllsch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.31 2017/04/24 12:58:15 jakllsch Exp $"); #include <sys/types.h> #include <sys/malloc.h> @@ -122,7 +122,8 @@ bus_space_read_stream_4(bus_space_tag_t } static inline void -bus_space_read_region_stream_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, uint32_t *p, bus_size_t c) +bus_space_read_region_stream_4(bus_space_tag_t t, bus_space_handle_t h, + bus_size_t o, uint32_t *p, bus_size_t c) { bus_space_read_region_4(t, h, o, p, c); for (bus_size_t i = 0; i < c; i++) { @@ -161,8 +162,8 @@ static void siisata_reinit_port(struct a static void siisata_device_reset(struct ata_channel *); static void siisata_activate_prb(struct siisata_channel *, int); static void siisata_deactivate_prb(struct siisata_channel *, int); -static int siisata_dma_setup(struct ata_channel *chp, int slot, - void *data, size_t, int); +static int siisata_dma_setup(struct ata_channel *chp, int, void *, + size_t, int); #if NATAPIBUS > 0 void siisata_atapibus_attach(struct atabus_softc *); @@ -171,7 +172,6 @@ void siisata_atapi_minphys(struct buf *) void siisata_atapi_start(struct ata_channel *,struct ata_xfer *); int siisata_atapi_complete(struct ata_channel *, struct ata_xfer *, int); void siisata_atapi_kill_xfer(struct ata_channel *, struct ata_xfer *, int); -void siisata_atapi_done(struct ata_channel *, struct ata_xfer *, int); void siisata_atapi_scsipi_request(struct scsipi_channel *, scsipi_adapter_req_t, void *); void siisata_atapi_kill_pending(struct scsipi_periph *); @@ -219,7 +219,7 @@ siisata_attach(struct siisata_softc *sc) sc->sc_atac.atac_set_modes = siisata_setup_channel; #if NATAPIBUS > 0 sc->sc_atac.atac_atapibus_attach = siisata_atapibus_attach; -#endif +#endif /* come out of reset state */ GRWRITE(sc, GR_GC, 0); @@ -228,9 +228,8 @@ siisata_attach(struct siisata_softc *sc) siisata_attach_port(sc, i); } - SIISATA_DEBUG_PRINT(("%s: %s: GR_GC: 0x%08x\n", - SIISATANAME(sc), __func__, GRREAD(sc, GR_GC)), - DEBUG_FUNCS); + SIISATA_DEBUG_PRINT(("%s: %s: GR_GC: 0x%08x\n", SIISATANAME(sc), + __func__, GRREAD(sc, GR_GC)), DEBUG_FUNCS); return; } @@ -449,7 +448,7 @@ siisata_resume(struct siisata_softc *sc) for (i = 0; i < sc->sc_atac.atac_nchannels; i++) { siisata_init_port(sc, i); } - + } int @@ -486,8 +485,8 @@ siisata_intr_port(struct siisata_channel pis = PRREAD(sc, PRX(chp->ch_channel, PRO_PIS)); - SIISATA_DEBUG_PRINT(("%s: %s port %d, pis 0x%x ", - SIISATANAME(sc), __func__, chp->ch_channel, pis), DEBUG_INTR); + SIISATA_DEBUG_PRINT(("%s: %s port %d, pis 0x%x ", SIISATANAME(sc), + __func__, chp->ch_channel, pis), DEBUG_INTR); if (pis & PR_PIS_CMDCMPL) { /* get slot status, clearing completion interrupt */ @@ -500,7 +499,7 @@ siisata_intr_port(struct siisata_channel "completion on port %d\n", SIISATANAME(sc), chp->ch_channel); return; - } + } if ((~pss & __BIT(slot)) == 0) { aprint_error( "%s: unknown slot " "completion on port %d, pss 0x%x\n", @@ -521,7 +520,7 @@ siisata_intr_port(struct siisata_channel /* read in specific information about error */ prbfis = bus_space_read_stream_4( sc->sc_prt, sc->sc_prh, - PRSX(chp->ch_channel, slot, PRSO_FIS)); + PRSX(chp->ch_channel, slot, PRSO_FIS)); /* set ch_status and ch_error */ satafis_rdh_parse(chp, (uint8_t *)&prbfis); } @@ -829,9 +828,8 @@ siisata_cmd_start(struct ata_channel *ch int i; SIISATA_DEBUG_PRINT(("%s: %s port %d drive %d command 0x%x, slot %d\n", - SIISATANAME((struct siisata_softc *)chp->ch_atac), - __func__, chp->ch_channel, xfer->c_drive, - ata_c->r_command, slot), + SIISATANAME((struct siisata_softc *)chp->ch_atac), __func__, + chp->ch_channel, xfer->c_drive, ata_c->r_command, slot), DEBUG_FUNCS|DEBUG_XFERS); chp->ch_status = 0; @@ -854,7 +852,7 @@ siisata_cmd_start(struct ata_channel *ch if (siisata_dma_setup(chp, slot, (ata_c->flags & (AT_READ | AT_WRITE)) ? ata_c->data : NULL, ata_c->bcount, - (ata_c->flags & AT_READ) ? BUS_DMA_READ : BUS_DMA_WRITE)) { + (ata_c->flags & AT_READ) ? BUS_DMA_READ : BUS_DMA_WRITE)) { ata_c->flags |= AT_DF; siisata_cmd_complete(chp, xfer, slot); return; @@ -893,8 +891,9 @@ siisata_cmd_start(struct ata_channel *ch /* reenable interrupts */ siisata_enable_port_interrupt(chp); out: - SIISATA_DEBUG_PRINT( - ("%s: %s: done\n", SIISATANAME((struct siisata_softc *)chp->ch_atac), __func__), DEBUG_FUNCS); + SIISATA_DEBUG_PRINT(("%s: %s: done\n", + SIISATANAME((struct siisata_softc *)chp->ch_atac), __func__), + DEBUG_FUNCS); return; } @@ -927,8 +926,8 @@ siisata_cmd_complete(struct ata_channel struct siisata_softc *sc = (struct siisata_softc *)chp->ch_atac; #endif - SIISATA_DEBUG_PRINT( - ("%s: %s\n", SIISATANAME(sc), __func__), DEBUG_FUNCS|DEBUG_XFERS); + SIISATA_DEBUG_PRINT(("%s: %s\n", SIISATANAME(sc), __func__), + DEBUG_FUNCS|DEBUG_XFERS); chp->ch_flags &= ~ATACH_IRQ_WAIT; if (xfer->c_flags & C_TIMEOU) @@ -945,7 +944,8 @@ siisata_cmd_complete(struct ata_channel if (chp->ch_drive[xfer->c_drive].drive_flags & ATA_DRIVE_WAITDRAIN) { siisata_cmd_kill_xfer(chp, xfer, KILL_GONE); - chp->ch_drive[xfer->c_drive].drive_flags &= ~ATA_DRIVE_WAITDRAIN; + chp->ch_drive[xfer->c_drive].drive_flags &= + ~ATA_DRIVE_WAITDRAIN; wakeup(&chp->ch_queue->active_xfer); return 0; } else @@ -964,9 +964,8 @@ siisata_cmd_done(struct ata_channel *chp uint16_t *idwordbuf; int i; - SIISATA_DEBUG_PRINT( - ("%s: %s flags 0x%x error 0x%x\n", SIISATANAME(sc), __func__, - ata_c->flags, ata_c->r_error), DEBUG_FUNCS|DEBUG_XFERS); + SIISATA_DEBUG_PRINT(("%s: %s flags 0x%x error 0x%x\n", SIISATANAME(sc), + __func__, ata_c->flags, ata_c->r_error), DEBUG_FUNCS|DEBUG_XFERS); siisata_deactivate_prb(schp, slot); @@ -1014,9 +1013,9 @@ siisata_ata_bio(struct ata_drive_datas * struct ata_channel *chp = drvp->chnl_softc; struct ata_xfer *xfer; - SIISATA_DEBUG_PRINT( ("%s: %s.\n", - SIISATANAME((struct siisata_softc *)chp->ch_atac), - __func__), DEBUG_FUNCS); + SIISATA_DEBUG_PRINT(("%s: %s.\n", + SIISATANAME((struct siisata_softc *)chp->ch_atac), __func__), + DEBUG_FUNCS); xfer = ata_get_xfer(ATAXF_NOSLEEP); if (xfer == NULL) @@ -1044,10 +1043,9 @@ siisata_bio_start(struct ata_channel *ch int slot = SIISATA_NON_NCQ_SLOT; int i; - SIISATA_DEBUG_PRINT( - ("%s: %s port %d, slot %d\n", - SIISATANAME((struct siisata_softc *)chp->ch_atac), __func__, chp->ch_channel, slot), - DEBUG_FUNCS); + SIISATA_DEBUG_PRINT(("%s: %s port %d, slot %d\n", + SIISATANAME((struct siisata_softc *)chp->ch_atac), __func__, + chp->ch_channel, slot), DEBUG_FUNCS); chp->ch_status = 0; chp->ch_error = 0; @@ -1096,8 +1094,9 @@ siisata_bio_start(struct ata_channel *ch siisata_enable_port_interrupt(chp); out: - SIISATA_DEBUG_PRINT( - ("%s: %s: done\n", SIISATANAME((struct siisata_softc *)chp->ch_atac), __func__), DEBUG_FUNCS); + SIISATA_DEBUG_PRINT(("%s: %s: done\n", + SIISATANAME((struct siisata_softc *)chp->ch_atac), __func__), + DEBUG_FUNCS); return; } @@ -1111,8 +1110,8 @@ siisata_bio_kill_xfer(struct ata_channel int slot = SIISATA_NON_NCQ_SLOT; SIISATA_DEBUG_PRINT(("%s: %s: port %d\n", - SIISATANAME((struct siisata_softc *)chp->ch_atac), - __func__, chp->ch_channel), DEBUG_FUNCS); + SIISATANAME((struct siisata_softc *)chp->ch_atac), __func__, + chp->ch_channel), DEBUG_FUNCS); siisata_deactivate_prb(schp, slot); @@ -1158,7 +1157,8 @@ siisata_bio_complete(struct ata_channel if (chp->ch_drive[xfer->c_drive].drive_flags & ATA_DRIVE_WAITDRAIN) { siisata_bio_kill_xfer(chp, xfer, KILL_GONE); - chp->ch_drive[xfer->c_drive].drive_flags &= ~ATA_DRIVE_WAITDRAIN; + chp->ch_drive[xfer->c_drive].drive_flags &= + ~ATA_DRIVE_WAITDRAIN; wakeup(&chp->ch_queue->active_xfer); return 0; } @@ -1174,8 +1174,8 @@ siisata_bio_complete(struct ata_channel } else if (chp->ch_status & WDCS_CORR) ata_bio->flags |= ATA_CORR; - SIISATA_DEBUG_PRINT(("%s: %s bcount: %ld", SIISATANAME(sc), - __func__, ata_bio->bcount), DEBUG_XFERS); + SIISATA_DEBUG_PRINT(("%s: %s bcount: %ld", SIISATANAME(sc), __func__, + ata_bio->bcount), DEBUG_XFERS); if (ata_bio->error == NOERROR) { if (ata_bio->flags & ATA_READ) ata_bio->bcount -= @@ -1183,7 +1183,7 @@ siisata_bio_complete(struct ata_channel else ata_bio->bcount = 0; } - SIISATA_DEBUG_PRINT((" now %ld\n", ata_bio->bcount), DEBUG_XFERS); + SIISATA_DEBUG_PRINT((" now %ld\n", ata_bio->bcount), DEBUG_XFERS); if (ata_bio->flags & ATA_POLL) return 1; (*chp->ch_drive[drive].drv_done)(chp->ch_drive[drive].drv_softc); @@ -1284,7 +1284,7 @@ static void siisata_deactivate_prb(struct siisata_channel *schp, int slot) { struct siisata_softc *sc; - + sc = (struct siisata_softc *)schp->ata_channel.ch_atac; KASSERTMSG((schp->sch_active_slots & __BIT(slot)) != 0, @@ -1422,8 +1422,8 @@ siisata_atapi_probe_device(struct atapib /* if no ATAPI device detected at attach time, skip */ if (drvp->drive_type != ATA_DRIVET_ATAPI) { - SIISATA_DEBUG_PRINT(("%s: drive %d " - "not present\n", __func__, target), DEBUG_PROBE); + SIISATA_DEBUG_PRINT(("%s: drive %d not present\n", __func__, + target), DEBUG_PROBE); return; } @@ -1479,7 +1479,7 @@ siisata_atapi_probe_device(struct atapib if ((id->atap_config & ATAPI_CFG_CMD_MASK) == ATAPI_CFG_CMD_16) { periph->periph_cap |= PERIPH_CAP_CMD16; - + /* configure port for packet length */ PRWRITE(siic, PRX(chp->ch_channel, PRO_PCS), PR_PC_PACKET_LENGTH); @@ -1648,8 +1648,9 @@ siisata_atapi_start(struct ata_channel * /* reenable interrupts */ siisata_enable_port_interrupt(chp); out: - SIISATA_DEBUG_PRINT( - ("%s: %s: done\n", SIISATANAME((struct siisata_softc *)chp->ch_atac), __func__), DEBUG_FUNCS); + SIISATA_DEBUG_PRINT(("%s: %s: done\n", + SIISATANAME((struct siisata_softc *)chp->ch_atac), __func__), + DEBUG_FUNCS); return; } @@ -1661,8 +1662,8 @@ siisata_atapi_complete(struct ata_channe struct siisata_channel *schp = (struct siisata_channel *)chp; struct scsipi_xfer *sc_xfer = xfer->c_cmd; - SIISATA_DEBUG_PRINT( - ("%s: %s()\n", SIISATANAME(sc), __func__), DEBUG_INTR); + SIISATA_DEBUG_PRINT(("%s: %s()\n", SIISATANAME(sc), __func__), + DEBUG_INTR); /* this comamnd is not active any more */ schp->sch_active_slots &= ~__BIT(slot); @@ -1682,7 +1683,8 @@ siisata_atapi_complete(struct ata_channe if (chp->ch_drive[xfer->c_drive].drive_flags & ATA_DRIVE_WAITDRAIN) { siisata_atapi_kill_xfer(chp, xfer, KILL_GONE); - chp->ch_drive[xfer->c_drive].drive_flags &= ~ATA_DRIVE_WAITDRAIN; + chp->ch_drive[xfer->c_drive].drive_flags &= + ~ATA_DRIVE_WAITDRAIN; wakeup(&chp->ch_queue->active_xfer); return 0; /* XXX verify */ } @@ -1692,7 +1694,7 @@ siisata_atapi_complete(struct ata_channe sc_xfer->resid = sc_xfer->datalen; sc_xfer->resid -= PRREAD(sc, PRSX(chp->ch_channel, slot, PRSO_RTC)); SIISATA_DEBUG_PRINT(("%s: %s datalen %d resid %d\n", SIISATANAME(sc), - __func__, sc_xfer->datalen, sc_xfer->resid), DEBUG_XFERS); + __func__, sc_xfer->datalen, sc_xfer->resid), DEBUG_XFERS); if ((chp->ch_status & WDCS_ERR) && ((sc_xfer->xs_control & XS_CTL_REQSENSE) == 0 || sc_xfer->resid == sc_xfer->datalen)) {