diff options
author | 2020-08-08 12:40:55 +0000 | |
---|---|---|
committer | 2020-08-08 12:40:55 +0000 | |
commit | 0e602b669a596d665fe233f1a5ef63b885050ecb (patch) | |
tree | 5e7e1567fefae5a1e39a513f5ca44f75c1e1a9cb | |
parent | Replace strto*l(3) with strtonum(3) (diff) | |
download | wireguard-openbsd-0e602b669a596d665fe233f1a5ef63b885050ecb.tar.xz wireguard-openbsd-0e602b669a596d665fe233f1a5ef63b885050ecb.zip |
The only thing worse than trailing whitespace is leading spaces instead of tabs.
-rw-r--r-- | sys/dev/ic/adv.c | 102 | ||||
-rw-r--r-- | sys/dev/ic/advlib.c | 18 | ||||
-rw-r--r-- | sys/dev/ic/adw.c | 60 | ||||
-rw-r--r-- | sys/dev/ic/adwlib.c | 16 | ||||
-rw-r--r-- | sys/dev/ic/adwlib.h | 18 |
5 files changed, 107 insertions, 107 deletions
diff --git a/sys/dev/ic/adv.c b/sys/dev/ic/adv.c index a786ea62213..4a2aebb4922 100644 --- a/sys/dev/ic/adv.c +++ b/sys/dev/ic/adv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: adv.c,v 1.49 2020/07/24 12:43:31 krw Exp $ */ +/* $OpenBSD: adv.c,v 1.50 2020/08/08 12:40:55 krw Exp $ */ /* $NetBSD: adv.c,v 1.6 1998/10/28 20:39:45 dante Exp $ */ /* @@ -103,8 +103,8 @@ adv_alloc_ccbs(sc) int error, rseg; /* - * Allocate the control blocks. - */ + * Allocate the control blocks. + */ if ((error = bus_dmamem_alloc(sc->sc_dmat, sizeof(struct adv_control), NBPG, 0, &seg, 1, &rseg, BUS_DMA_NOWAIT | BUS_DMA_ZERO)) != 0) { @@ -120,8 +120,8 @@ adv_alloc_ccbs(sc) return (error); } /* - * Create and load the DMA map used for the control blocks. - */ + * Create and load the DMA map used for the control blocks. + */ if ((error = bus_dmamap_create(sc->sc_dmat, sizeof(struct adv_control), 1, sizeof(struct adv_control), 0, BUS_DMA_NOWAIT, &sc->sc_dmamap_control)) != 0) { @@ -203,8 +203,8 @@ adv_init_ccb(sc, ccb) int error; /* - * Create the DMA map for this CCB. - */ + * Create the DMA map for this CCB. + */ error = bus_dmamap_create(sc->sc_dmat, (ASC_MAX_SG_LIST - 1) * PAGE_SIZE, ASC_MAX_SG_LIST, (ASC_MAX_SG_LIST - 1) * PAGE_SIZE, @@ -307,9 +307,9 @@ adv_alloc_overrunbuf(dvname, dmat) /* - * if an overrun buffer has been already allocated don't allocate it - * again. Instead return the address of the allocated buffer. - */ + * if an overrun buffer has been already allocated don't allocate it + * again. Instead return the address of the allocated buffer. + */ if (overrunbuf) return (overrunbuf); @@ -366,8 +366,8 @@ adv_init(sc) panic("adv_init: adv_find_signature failed"); /* - * Read the board configuration - */ + * Read the board configuration + */ AscInitASC_SOFTC(sc); warn = AscInitFromEEP(sc); if (warn) { @@ -410,8 +410,8 @@ adv_init(sc) sc->scsi_reset_wait = ASC_MAX_SCSI_RESET_WAIT; /* - * Modify the board configuration - */ + * Modify the board configuration + */ warn = AscInitFromASC_SOFTC(sc); if (warn) { printf("%s -set: ", sc->sc_dev.dv_xname); @@ -447,8 +447,8 @@ adv_attach(sc) int i, error; /* - * Initialize board RISC chip and enable interrupts. - */ + * Initialize board RISC chip and enable interrupts. + */ switch (AscInitDriver(sc)) { case 0: /* AllOK */ @@ -480,15 +480,15 @@ adv_attach(sc) scsi_iopool_init(&sc->sc_iopool, sc, adv_ccb_alloc, adv_ccb_free); /* - * Allocate the Control Blocks. - */ + * Allocate the Control Blocks. + */ error = adv_alloc_ccbs(sc); if (error) return; /* (error) */ ; /* - * Create and initialize the Control Blocks. - */ + * Create and initialize the Control Blocks. + */ i = adv_create_ccbs(sc, sc->sc_control->ccbs, ADV_MAX_CCB); if (i == 0) { printf("%s: unable to create control blocks\n", @@ -528,10 +528,10 @@ adv_scsi_cmd(xs) int flags, error, nsegs; /* - * get a ccb to use. If the transfer - * is from a buf (possibly from interrupt time) - * then we can't allow it to sleep - */ + * get a ccb to use. If the transfer + * is from a buf (possibly from interrupt time) + * then we can't allow it to sleep + */ flags = xs->flags; ccb = xs->io; @@ -540,8 +540,8 @@ adv_scsi_cmd(xs) ccb->timeout = xs->timeout; /* - * Build up the request - */ + * Build up the request + */ memset(&ccb->scsiq, 0, sizeof(ASC_SCSI_Q)); ccb->scsiq.q2.ccb_ptr = (ulong) ccb; @@ -557,12 +557,12 @@ adv_scsi_cmd(xs) ccb->scsiq.q1.sense_len = sizeof(struct scsi_sense_data); /* - * If there are any outstanding requests for the current target, - * then every 255th request send an ORDERED request. This heuristic - * tries to retain the benefit of request sorting while preventing - * request starvation. 255 is the max number of tags or pending commands - * a device may have outstanding. - */ + * If there are any outstanding requests for the current target, + * then every 255th request send an ORDERED request. This heuristic + * tries to retain the benefit of request sorting while preventing + * request starvation. 255 is the max number of tags or pending commands + * a device may have outstanding. + */ sc->reqcnt[sc_link->target]++; if ((sc->reqcnt[sc_link->target] > 0) && (sc->reqcnt[sc_link->target] % 255) == 0) { @@ -574,8 +574,8 @@ adv_scsi_cmd(xs) if (xs->datalen) { /* - * Map the DMA transfer. - */ + * Map the DMA transfer. + */ error = bus_dmamap_load(dmat, ccb->dmamap_xfer, xs->data, xs->datalen, NULL, (flags & SCSI_NOSLEEP) ? BUS_DMA_NOWAIT : BUS_DMA_WAITOK); @@ -620,8 +620,8 @@ adv_scsi_cmd(xs) ccb->scsiq.q1.data_cnt = 0; } else { /* - * No data xfer, use non S/G values. - */ + * No data xfer, use non S/G values. + */ ccb->scsiq.q1.data_addr = 0; ccb->scsiq.q1.data_cnt = 0; } @@ -633,14 +633,14 @@ adv_scsi_cmd(xs) (unsigned long)ccb); #endif /* - * Usually return SUCCESSFULLY QUEUED - */ + * Usually return SUCCESSFULLY QUEUED + */ if ((flags & SCSI_POLL) == 0) return; /* - * If we can't use interrupts, poll on completion - */ + * If we can't use interrupts, poll on completion + */ if (adv_poll(sc, xs, ccb->timeout)) { adv_timeout(ccb); if (adv_poll(sc, xs, ccb->timeout)) @@ -715,9 +715,9 @@ adv_timeout(arg) s = splbio(); /* - * If it has been through before, then a previous abort has failed, - * don't try abort again, reset the bus instead. - */ + * If it has been through before, then a previous abort has failed, + * don't try abort again, reset the bus instead. + */ if (ccb->flags & CCB_ABORT) { /* abort timed out */ printf(" AGAIN. Resetting Bus\n"); @@ -789,9 +789,9 @@ adv_narrow_isr_callback(sc, qdonep) timeout_del(&xs->stimeout); /* - * If we were a data transfer, unload the map that described - * the data buffer. - */ + * If we were a data transfer, unload the map that described + * the data buffer. + */ if (xs->datalen) { bus_dmamap_sync(dmat, ccb->dmamap_xfer, 0, ccb->dmamap_xfer->dm_mapsize, @@ -804,8 +804,8 @@ adv_narrow_isr_callback(sc, qdonep) return; } /* - * 'qdonep' contains the command's ending status. - */ + * 'qdonep' contains the command's ending status. + */ #ifdef ASC_DEBUG printf("d_s=%d, h_s=%d", qdonep->d3.done_stat, qdonep->d3.host_stat); #endif @@ -824,9 +824,9 @@ adv_narrow_isr_callback(sc, qdonep) } /* - * If an INQUIRY command completed successfully, then call - * the AscInquiryHandling() function to patch bugged boards. - */ + * If an INQUIRY command completed successfully, then call + * the AscInquiryHandling() function to patch bugged boards. + */ if ((xs->cmd->opcode == SCSICMD_Inquiry) && (xs->sc_link->lun == 0) && (xs->datalen - qdonep->remain_bytes) >= 8) { diff --git a/sys/dev/ic/advlib.c b/sys/dev/ic/advlib.c index 8386ec2807b..92432e52b47 100644 --- a/sys/dev/ic/advlib.c +++ b/sys/dev/ic/advlib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: advlib.c,v 1.15 2017/09/08 05:36:52 deraadt Exp $ */ +/* $OpenBSD: advlib.c,v 1.16 2020/08/08 12:40:55 krw Exp $ */ /* $NetBSD: advlib.c,v 1.7 1998/10/28 20:39:46 dante Exp $ */ /* @@ -177,18 +177,18 @@ static u_int16_t AscSetIsaDmaChannel(bus_space_tag_t, bus_space_handle_t, static u_int8_t AscGetIsaDmaSpeed(bus_space_tag_t, bus_space_handle_t); static u_int8_t AscSetIsaDmaSpeed(bus_space_tag_t, bus_space_handle_t, u_int8_t); - + /* Messages routines */ static void AscHandleExtMsgIn(ASC_SOFTC *, u_int16_t, u_int8_t, ASC_SCSI_BIT_ID_TYPE, int, u_int8_t); static u_int8_t AscMsgOutSDTR(ASC_SOFTC *, u_int8_t, u_int8_t); - + /* SDTR routines */ static void AscSetChipSDTR(bus_space_tag_t, bus_space_handle_t, u_int8_t, u_int8_t); static u_int8_t AscCalSDTRData(ASC_SOFTC *, u_int8_t, u_int8_t); static u_int8_t AscGetSynPeriodIndex(ASC_SOFTC *, u_int8_t); - + /* Queue routines */ static int AscSendScsiQueue(ASC_SOFTC *, ASC_SCSI_Q *, u_int8_t); static int AscSgListToQueue(int); @@ -208,21 +208,21 @@ static void AscCleanUpBusyQueue(bus_space_tag_t, bus_space_handle_t); static int _AscWaitQDone(bus_space_tag_t, bus_space_handle_t, ASC_SCSI_Q *); static int AscCleanUpDiscQueue(bus_space_tag_t, bus_space_handle_t); - + /* Abort and Reset CCB routines */ static int AscRiscHaltedAbortCCB(ASC_SOFTC *, u_int32_t); static int AscRiscHaltedAbortTIX(ASC_SOFTC *, u_int8_t); - + /* Error Handling routines */ static int AscSetLibErrorCode(ASC_SOFTC *, u_int16_t); - + /* Handle bugged borads routines */ static int AscTagQueuingSafe(ASC_SCSI_INQUIRY *); static void AscAsyncFix(ASC_SOFTC *, u_int8_t, ASC_SCSI_INQUIRY *); - + /* Miscellaneous routines */ static int AscCompareString(u_char *, u_char *, int); - + /* Device oriented routines */ static int DvcEnterCritical(void); static void DvcLeaveCritical(int); diff --git a/sys/dev/ic/adw.c b/sys/dev/ic/adw.c index 88aa5b2c9af..fddc8b42936 100644 --- a/sys/dev/ic/adw.c +++ b/sys/dev/ic/adw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: adw.c,v 1.66 2020/07/20 14:41:13 krw Exp $ */ +/* $OpenBSD: adw.c,v 1.67 2020/08/08 12:40:55 krw Exp $ */ /* $NetBSD: adw.c,v 1.23 2000/05/27 18:24:50 dante Exp $ */ /* @@ -98,8 +98,8 @@ adw_alloc_controls(ADW_SOFTC *sc) int error, rseg; /* - * Allocate the control structure. - */ + * Allocate the control structure. + */ if ((error = bus_dmamem_alloc(sc->sc_dmat, sizeof(struct adw_control), NBPG, 0, &seg, 1, &rseg, BUS_DMA_NOWAIT | BUS_DMA_ZERO)) != 0) { printf("%s: unable to allocate control structures," @@ -115,8 +115,8 @@ adw_alloc_controls(ADW_SOFTC *sc) } /* - * Create and load the DMA map used for the control blocks. - */ + * Create and load the DMA map used for the control blocks. + */ if ((error = bus_dmamap_create(sc->sc_dmat, sizeof(struct adw_control), 1, sizeof(struct adw_control), 0, BUS_DMA_NOWAIT, &sc->sc_dmamap_control)) != 0) { @@ -143,8 +143,8 @@ adw_alloc_carriers(ADW_SOFTC *sc) int error, rseg; /* - * Allocate the control structure. - */ + * Allocate the control structure. + */ sc->sc_control->carriers = malloc(ADW_MAX_CARRIER * sizeof(ADW_CARRIER), M_DEVBUF, M_NOWAIT); @@ -169,8 +169,8 @@ adw_alloc_carriers(ADW_SOFTC *sc) } /* - * Create and load the DMA map used for the control blocks. - */ + * Create and load the DMA map used for the control blocks. + */ if ((error = bus_dmamap_create(sc->sc_dmat, sizeof(ADW_CARRIER) * ADW_MAX_CARRIER, 1, sizeof(ADW_CARRIER) * ADW_MAX_CARRIER, 0,BUS_DMA_NOWAIT, @@ -252,8 +252,8 @@ adw_init_ccb(ADW_SOFTC *sc, ADW_CCB *ccb) int hashnum, error; /* - * Create the DMA map for this CCB. - */ + * Create the DMA map for this CCB. + */ error = bus_dmamap_create(sc->sc_dmat, (ADW_MAX_SG_LIST - 1) * PAGE_SIZE, ADW_MAX_SG_LIST, (ADW_MAX_SG_LIST - 1) * PAGE_SIZE, @@ -419,8 +419,8 @@ adw_attach(ADW_SOFTC *sc) scsi_iopool_init(&sc->sc_iopool, sc, adw_ccb_alloc, adw_ccb_free); /* - * Allocate the Control Blocks. - */ + * Allocate the Control Blocks. + */ error = adw_alloc_controls(sc); if (error) return; /* (error) */ ; @@ -529,10 +529,10 @@ adw_scsi_cmd(struct scsi_xfer *xs) int s, retry = 0; /* - * get a ccb to use. If the transfer - * is from a buf (possibly from interrupt time) - * then we can't allow it to sleep - */ + * get a ccb to use. If the transfer + * is from a buf (possibly from interrupt time) + * then we can't allow it to sleep + */ ccb = xs->io; @@ -559,8 +559,8 @@ retryagain: return; /* - * If we can't use interrupts, poll on completion - */ + * If we can't use interrupts, poll on completion + */ if (adw_poll(sc, xs, ccb->timeout)) { adw_timeout(ccb); if (adw_poll(sc, xs, ccb->timeout)) @@ -620,8 +620,8 @@ adw_build_req(struct scsi_xfer *xs, ADW_CCB *ccb, int flags) */ if (xs->datalen) { /* - * Map the DMA transfer. - */ + * Map the DMA transfer. + */ error = bus_dmamap_load(dmat, ccb->dmamap_xfer, xs->data, xs->datalen, NULL, (flags & SCSI_NOSLEEP) ? @@ -656,8 +656,8 @@ adw_build_req(struct scsi_xfer *xs, ADW_CCB *ccb, int flags) adw_build_sglist(ccb, scsiqp, ccb->sg_block); } else { /* - * No data xfer, use non S/G values. - */ + * No data xfer, use non S/G values. + */ scsiqp->data_cnt = 0; scsiqp->vdata_addr = 0; scsiqp->data_addr = 0; @@ -865,7 +865,7 @@ adw_reset_bus(ADW_SOFTC *sc) AdwResetSCSIBus(sc); /* XXX - should check return value? */ while((ccb = TAILQ_LAST(&sc->sc_pending_ccb, adw_pending_ccb)) != NULL) { - timeout_del(&ccb->xs->stimeout); + timeout_del(&ccb->xs->stimeout); TAILQ_REMOVE(&sc->sc_pending_ccb, ccb, chain); TAILQ_INSERT_HEAD(&sc->sc_waiting_ccb, ccb, chain); } @@ -964,15 +964,15 @@ adw_isr_callback(ADW_SOFTC *sc, ADW_SCSI_REQ_Q *scsiq) timeout_del(&xs->stimeout); /* - * If we were a data transfer, unload the map that described - * the data buffer. - */ + * If we were a data transfer, unload the map that described + * the data buffer. + */ dmat = sc->sc_dmat; if (xs->datalen) { bus_dmamap_sync(dmat, ccb->dmamap_xfer, 0, ccb->dmamap_xfer->dm_mapsize, ((xs->flags & SCSI_DATA_IN) ? - BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE)); + BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE)); bus_dmamap_unload(dmat, ccb->dmamap_xfer); } @@ -1152,7 +1152,7 @@ adw_async_callback(ADW_SOFTC *sc, u_int8_t code) case ADW_ASYNC_CARRIER_READY_FAILURE: /* * Carrier Ready failure. - * + * * A warning only - RISC too busy to realize it's been * tickled. Occurs in normal operation under heavy * load, so a message is printed only when ADW_DEBUG'ing @@ -1163,7 +1163,7 @@ adw_async_callback(ADW_SOFTC *sc, u_int8_t code) break; default: - printf("%s: Unknown Async callback code (ignored): 0x%02x\n", + printf("%s: Unknown Async callback code (ignored): 0x%02x\n", sc->sc_dev.dv_xname, code); break; } diff --git a/sys/dev/ic/adwlib.c b/sys/dev/ic/adwlib.c index 851d18fdb80..ef2c659298b 100644 --- a/sys/dev/ic/adwlib.c +++ b/sys/dev/ic/adwlib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: adwlib.c,v 1.26 2020/02/18 20:24:52 krw Exp $ */ +/* $OpenBSD: adwlib.c,v 1.27 2020/08/08 12:40:55 krw Exp $ */ /* $NetBSD: adwlib.c,v 1.20 2000/07/04 04:17:03 itojun Exp $ */ /* @@ -67,17 +67,17 @@ int AdwRamSelfTest(bus_space_tag_t, bus_space_handle_t, u_int8_t); int AdwLoadMCode(bus_space_tag_t, bus_space_handle_t, u_int16_t *, - u_int8_t); + u_int8_t); int AdwASC3550Cabling(bus_space_tag_t, bus_space_handle_t, ADW_DVC_CFG *); int AdwASC38C0800Cabling(bus_space_tag_t, bus_space_handle_t, - ADW_DVC_CFG *); + ADW_DVC_CFG *); int AdwASC38C1600Cabling(bus_space_tag_t, bus_space_handle_t, - ADW_DVC_CFG *); + ADW_DVC_CFG *); u_int16_t AdwGetEEPROMConfig(bus_space_tag_t, bus_space_handle_t, - ADW_EEPROM *); + ADW_EEPROM *); void AdwSetEEPROMConfig(bus_space_tag_t, bus_space_handle_t, - ADW_EEPROM *); + ADW_EEPROM *); u_int16_t AdwReadEEPWord(bus_space_tag_t, bus_space_handle_t, int); void AdwWaitEEPCmd(bus_space_tag_t, bus_space_handle_t); @@ -2199,7 +2199,7 @@ AdwInquiryHandling(ADW_SOFTC *sc, ADW_SCSI_REQ_Q *scsiq) tid = scsiq->target_id; - inq = (ADW_SCSI_INQUIRY *) scsiq->vdata_addr; + inq = (ADW_SCSI_INQUIRY *) scsiq->vdata_addr; /* * WDTR, SDTR, and Tag Queuing cannot be enabled for old devices. @@ -2304,7 +2304,7 @@ AdwInquiryHandling(ADW_SOFTC *sc, ADW_SCSI_REQ_Q *scsiq) * and WDTR messages to negotiate synchronous speed * and offset, transfer width, and protocol options. */ - if((inq->Clocking) & INQ_CLOCKING_DT_ONLY){ + if((inq->Clocking) & INQ_CLOCKING_DT_ONLY){ ADW_READ_WORD_LRAM(iot, ioh, ADW_MC_PPR_ABLE, sc->ppr_able); sc->ppr_able |= tidmask; diff --git a/sys/dev/ic/adwlib.h b/sys/dev/ic/adwlib.h index ac08b6b7a8a..8c66b3e048f 100644 --- a/sys/dev/ic/adwlib.h +++ b/sys/dev/ic/adwlib.h @@ -1,4 +1,4 @@ -/* $OpenBSD: adwlib.h,v 1.16 2020/07/22 13:16:04 krw Exp $ */ +/* $OpenBSD: adwlib.h,v 1.17 2020/08/08 12:40:55 krw Exp $ */ /* $NetBSD: adwlib.h,v 1.14 2000/07/03 18:14:18 dante Exp $ */ /* @@ -521,10 +521,10 @@ typedef struct adw_eeprom x means don't-care (either '0' or '1') If term_pol (bit 13) is '0' (active-low terminator enable), then: - 'on' is '0' and 'off' is '1'. + 'on' is '0' and 'off' is '1'. - If term_pol bit is '1' (meaning active-hi terminator enable), then: - 'on' is '1' and 'off' is '0'. + If term_pol bit is '1' (meaning active-hi terminator enable), then: + 'on' is '1' and 'off' is '0'. */ /* @@ -1059,14 +1059,14 @@ typedef struct { u_int8_t aenc : 1; /* asynch. event notification (processor) */ u_int8_t add_len; /* additional length */ u_int8_t res2 : 7; /* reserved */ - u_int8_t SCC : 1; - u_int8_t Addr16 : 1; + u_int8_t SCC : 1; + u_int8_t Addr16 : 1; u_int8_t res3 : 2; /* reserved */ u_int8_t MChngr : 1; - u_int8_t MultiPort: 1; - u_int8_t res4 : 1; + u_int8_t MultiPort: 1; + u_int8_t res4 : 1; u_int8_t EncServ : 1; - u_int8_t BaseQue : 1; + u_int8_t BaseQue : 1; u_int8_t StfRe : 1; /* soft reset implemented */ u_int8_t CmdQue : 1; /* command queuing */ u_int8_t res5 : 1; /* reserved */ |