diff --git a/sys/dev/ic/aic79xx.c b/sys/dev/ic/aic79xx.c index 63e15cb7604b..c4872bc8f6ac 100644 --- a/sys/dev/ic/aic79xx.c +++ b/sys/dev/ic/aic79xx.c @@ -1,4 +1,4 @@ -/* $NetBSD: aic79xx.c,v 1.42 2009/09/02 16:38:17 tsutsui Exp $ */ +/* $NetBSD: aic79xx.c,v 1.43 2009/09/02 17:08:12 tsutsui Exp $ */ /* * Core routines and tables shareable across OS platforms. @@ -49,7 +49,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: aic79xx.c,v 1.42 2009/09/02 16:38:17 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: aic79xx.c,v 1.43 2009/09/02 17:08:12 tsutsui Exp $"); #include #include @@ -75,7 +75,7 @@ const char *ahd_chip_names[] = * Hardware error codes. */ struct ahd_hard_error_entry { - uint8_t errno; + uint8_t errno; const char *errmesg; }; @@ -1445,7 +1445,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) /* * Remove the second instance of this SCB from * the QINFIFO if it is still there. - */ + */ ahd_print_path(ahd, scb); printf("SCB completes before TMF\n"); /* @@ -1790,7 +1790,7 @@ ahd_handle_transmission_error(struct ahd_softc *ahd) silent = FALSE; if (lqistat1 == 0 || (lqistat1 & LQICRCI_NLQ) != 0) { - if ((lqistat1 & (LQICRCI_NLQ|LQIOVERI_NLQ)) != 0) + if ((lqistat1 & (LQICRCI_NLQ|LQIOVERI_NLQ)) != 0) ahd_set_active_fifo(ahd); scbid = ahd_get_scbptr(ahd); scb = ahd_lookup_scb(ahd, scbid); @@ -2008,7 +2008,7 @@ ahd_handle_pkt_busfree(struct ahd_softc *ahd, u_int busfreetime) scbid = ahd_inw(ahd, CURRSCB); scb = ahd_lookup_scb(ahd, scbid); if (scb == NULL) - panic("SCB not valid during LQOBUSFREE"); + panic("SCB not valid during LQOBUSFREE"); /* * Clear the status. */ @@ -2530,8 +2530,8 @@ ahd_clear_critical_section(struct ahd_softc *ahd) if (stepping == FALSE) { first_instr = seqaddr; - ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG); - simode0 = ahd_inb(ahd, SIMODE0); + ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG); + simode0 = ahd_inb(ahd, SIMODE0); simode3 = ahd_inb(ahd, SIMODE3); lqimode0 = ahd_inb(ahd, LQIMODE0); lqimode1 = ahd_inb(ahd, LQIMODE1); @@ -2573,7 +2573,7 @@ ahd_clear_critical_section(struct ahd_softc *ahd) ahd_outb(ahd, LQOMODE1, lqomode1); ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI); ahd_outb(ahd, SEQCTL0, ahd_inb(ahd, SEQCTL0) & ~STEP); - ahd_outb(ahd, SIMODE1, simode1); + ahd_outb(ahd, SIMODE1, simode1); /* * SCSIINT seems to glitch occassionally when * the interrupt masks are restored. Clear SCSIINT @@ -2990,7 +2990,7 @@ ahd_set_syncrate(struct ahd_softc *ahd, struct ahd_devinfo *devinfo, old_period = tinfo->curr.period; old_offset = tinfo->curr.offset; - old_ppr = tinfo->curr.ppr_options; + old_ppr = tinfo->curr.ppr_options; if ((type & AHD_TRANS_CUR) != 0 && (old_period != period @@ -4265,7 +4265,7 @@ ahd_parse_msg(struct ahd_softc *ahd, struct ahd_devinfo *devinfo) /* * Send our own SDTR in reply */ - if (bootverbose + if (bootverbose && devinfo->role == ROLE_INITIATOR) { printf("(%s:%c:%d:%d): Target " "Initiated SDTR\n", @@ -4338,7 +4338,7 @@ ahd_parse_msg(struct ahd_softc *ahd, struct ahd_devinfo *devinfo) */ if (bootverbose && devinfo->role == ROLE_INITIATOR) { - printf("(%s:%c:%d:%d): Target " + printf("(%s:%c:%d:%d): Target " "Initiated WDTR\n", ahd_name(ahd), devinfo->channel, devinfo->target, devinfo->lun); @@ -4607,7 +4607,7 @@ ahd_handle_msg_reject(struct ahd_softc *ahd, struct ahd_devinfo *devinfo) * Attempt to negotiate 80MHz which will turn * off these options. */ - if (bootverbose) { + if (bootverbose) { printf("(%s:%c:%d:%d): PPR Rejected. " "Trying simple U160 PPR\n", ahd_name(ahd), devinfo->channel, @@ -4622,7 +4622,7 @@ ahd_handle_msg_reject(struct ahd_softc *ahd, struct ahd_devinfo *devinfo) * Target does not support the PPR message. * Attempt to negotiate SPI-2 style. */ - if (bootverbose) { + if (bootverbose) { printf("(%s:%c:%d:%d): PPR Rejected. " "Trying WDTR/SDTR\n", ahd_name(ahd), devinfo->channel, @@ -4700,7 +4700,7 @@ ahd_handle_msg_reject(struct ahd_softc *ahd, struct ahd_devinfo *devinfo) */ ahd_outb(ahd, SCB_CONTROL, ahd_inb_scbram(ahd, SCB_CONTROL) & mask); - scb->hscb->control &= mask; + scb->hscb->control &= mask; ahd_set_transaction_tag(scb, /*enabled*/FALSE, /*type*/MSG_SIMPLE_TASK); ahd_outb(ahd, MSG_OUT, MSG_IDENTIFYFLAG); @@ -4871,7 +4871,7 @@ ahd_handle_ign_wide_residue(struct ahd_softc *ahd, */ sg++; sgptr = ahd_sg_virt_to_bus(ahd, scb, - sg); + sg); } } /* @@ -5167,13 +5167,13 @@ ahd_free(struct ahd_softc *ahd) TAILQ_REMOVE(&ahd_tailq, ahd, links); /* FALLTHROUGH */ case 1: - bus_dmamap_unload(ahd->parent_dmat, ahd->shared_data_map.dmamap); + bus_dmamap_unload(ahd->parent_dmat, ahd->shared_data_map.dmamap); bus_dmamap_destroy(ahd->parent_dmat, ahd->shared_data_map.dmamap); bus_dmamem_unmap(ahd->parent_dmat, (void *)ahd->qoutfifo, ahd->shared_data_size); bus_dmamem_free(ahd->parent_dmat, &ahd->shared_data_map.dmasegs, ahd->shared_data_map.nseg); break; case 0: - break; + break; } ahd_platform_free(ahd); @@ -5250,7 +5250,7 @@ ahd_reset(struct ahd_softc *ahd, int reinit) u_int sxfrctl1; int wait; uint32_t cmd; - struct ahd_pci_busdata *bd = ahd->bus_data; + struct ahd_pci_busdata *bd = ahd->bus_data; /* * Preserve the value of the SXFRCTL1 register for all channels. @@ -5310,11 +5310,11 @@ ahd_reset(struct ahd_softc *ahd, int reinit) } /* - * Mode should be SCSI after a chip reset, but lets - * set it just to be safe. We touch the MODE_PTR + * Mode should be SCSI after a chip reset, but lets + * set it just to be safe. We touch the MODE_PTR * register directly so as to bypass the lazy update * ode in ahd_set_modes(). - */ + */ ahd_known_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI); ahd_outb(ahd, MODE_PTR, ahd_build_mode_state(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI)); @@ -7164,8 +7164,8 @@ ahd_search_qinfifo(struct ahd_softc *ahd, int target, char channel, switch (action) { case SEARCH_COMPLETE: { - cam_status ostat; - cam_status cstat; + cam_status ostat; + cam_status cstat; ostat = ahd_get_scsi_status(scb); if (ostat == CAM_REQ_INPROG) @@ -7904,7 +7904,7 @@ ahd_handle_scsi_status(struct ahd_softc *ahd, struct scb *scb) #ifdef AHD_DEBUG if ((ahd_debug & AHD_SHOW_SENSE) != 0) { printf("Sense data available (%d)\n", siu->sense_length[0]); - printf("SK 0x%x ASC 0x%x ASCQ 0x%x\n", + printf("SK 0x%x ASC 0x%x ASCQ 0x%x\n", ((uint8_t)scb->sense_data[SIU_SENSE_OFFSET(siu)+2]) & 0x0F, ((uint8_t)scb->sense_data[SIU_SENSE_OFFSET(siu)+12]), ((uint8_t)scb->sense_data[SIU_SENSE_OFFSET(siu)+13])); @@ -8103,7 +8103,7 @@ ahd_calc_residual(struct ahd_softc *ahd, struct scb *scb) } if ((scb->flags & SCB_SENSE) == 0) - ahd_set_residual(scb, resid); + ahd_set_residual(scb, resid); /*else ahd_set_sense_residual(scb, resid);*/ @@ -8353,9 +8353,9 @@ ahd_loadseq(struct ahd_softc *ahd) if (begin_set[cs_count] == TRUE && end_set[cs_count] == FALSE) { cs_table[cs_count].end = downloaded; - end_set[cs_count] = TRUE; + end_set[cs_count] = TRUE; cs_count++; - } + } continue; } if (critical_sections[cur_cs].begin <= i @@ -8537,8 +8537,8 @@ ahd_probe_stack_size(struct ahd_softc *ahd) * entries. */ for (i = 1; i <= last_probe+1; i++) { - ahd_outb(ahd, STACK, i & 0xFF); - ahd_outb(ahd, STACK, (i >> 8) & 0xFF); + ahd_outb(ahd, STACK, i & 0xFF); + ahd_outb(ahd, STACK, (i >> 8) & 0xFF); } /* Verify */ @@ -9074,7 +9074,7 @@ ahd_acquire_seeprom(struct ahd_softc *ahd) error = ahd_read_flexport(ahd, FLXADDR_ROMSTAT_CURSENSECTL, &seetype); if (error != 0 - || ((seetype & FLX_ROMSTAT_SEECFG) == FLX_ROMSTAT_SEE_NONE)) + || ((seetype & FLX_ROMSTAT_SEECFG) == FLX_ROMSTAT_SEE_NONE)) return (0); return (1); #endif @@ -9216,7 +9216,7 @@ ahd_handle_en_lun(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb) our_id = ahd->our_id; if (ccb->ccb_h.target_id != our_id) { if ((ahd->features & AHD_MULTI_TID) != 0 - && (ahd->flags & AHD_INITIATORROLE) != 0) { + && (ahd->flags & AHD_INITIATORROLE) != 0) { /* * Only allow additional targets if * the initiator role is disabled. @@ -9467,7 +9467,7 @@ ahd_handle_en_lun(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb) targid_mask &= ~target_mask; ahd_outb(ahd, TARGID, targid_mask); ahd_outb(ahd, TARGID+1, - (targid_mask >> 8)); + (targid_mask >> 8)); ahd_update_scsiid(ahd, targid_mask); } } @@ -9730,19 +9730,19 @@ ahd_createdmamem(bus_dma_tag_t tag, int size, int flags, bus_dmamap_t *mapp, voi if ((error = bus_dmamap_create(tag, size, 1, size, 0, BUS_DMA_WAITOK | flags, mapp)) != 0) { - printf("%s: failed to create DMA map for %s, error = %d\n", + printf("%s: failed to create DMA map for %s, error = %d\n", myname, what, error); goto out; - } + } level++; if ((error = bus_dmamap_load(tag, *mapp, *vaddr, size, NULL, BUS_DMA_WAITOK)) != 0) { - printf("%s: failed to load DMA map for %s, error = %d\n", + printf("%s: failed to load DMA map for %s, error = %d\n", myname, what, error); goto out; - } + } *baddr = (*mapp)->dm_segs[0].ds_addr; diff --git a/sys/dev/ic/aic79xx_inline.h b/sys/dev/ic/aic79xx_inline.h index 15f8a055b5a2..023a43a51dce 100644 --- a/sys/dev/ic/aic79xx_inline.h +++ b/sys/dev/ic/aic79xx_inline.h @@ -1,4 +1,4 @@ -/* $NetBSD: aic79xx_inline.h,v 1.17 2009/03/15 15:52:12 cegger Exp $ */ +/* $NetBSD: aic79xx_inline.h,v 1.18 2009/09/02 17:08:12 tsutsui Exp $ */ /* * Inline routines shareable across OS platforms. @@ -456,7 +456,7 @@ ahd_post_scb(struct ahd_softc *ahd, struct scb *scb) if ((sgptr & SG_STATUS_VALID) != 0) ahd_handle_scb_status(ahd, scb); else - ahd_done(ahd, scb); + ahd_done(ahd, scb); } static __inline void @@ -978,10 +978,10 @@ ahd_minphys(struct buf *bp) * discontinuous physically, hence the "page per segment" limit * enforced here. */ - if (bp->b_bcount > AHD_MAXTRANSFER_SIZE) { - bp->b_bcount = AHD_MAXTRANSFER_SIZE; - } - minphys(bp); + if (bp->b_bcount > AHD_MAXTRANSFER_SIZE) { + bp->b_bcount = AHD_MAXTRANSFER_SIZE; + } + minphys(bp); } static __inline u_int32_t scsi_4btoul(u_int8_t *); @@ -989,13 +989,13 @@ static __inline u_int32_t scsi_4btoul(u_int8_t *); static __inline u_int32_t scsi_4btoul(u_int8_t *bytes) { - u_int32_t rv; + u_int32_t rv; - rv = (bytes[0] << 24) | - (bytes[1] << 16) | - (bytes[2] << 8) | - bytes[3]; - return (rv); + rv = (bytes[0] << 24) | + (bytes[1] << 16) | + (bytes[2] << 8) | + bytes[3]; + return (rv); } diff --git a/sys/dev/ic/aic79xx_osm.c b/sys/dev/ic/aic79xx_osm.c index 835375457aa7..375d777c1cab 100644 --- a/sys/dev/ic/aic79xx_osm.c +++ b/sys/dev/ic/aic79xx_osm.c @@ -1,4 +1,4 @@ -/* $NetBSD: aic79xx_osm.c,v 1.22 2009/09/02 16:38:17 tsutsui Exp $ */ +/* $NetBSD: aic79xx_osm.c,v 1.23 2009/09/02 17:08:12 tsutsui Exp $ */ /* * Bus independent NetBSD shim for the aic7xxx based adaptec SCSI controllers @@ -41,7 +41,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: aic79xx_osm.c,v 1.22 2009/09/02 16:38:17 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: aic79xx_osm.c,v 1.23 2009/09/02 17:08:12 tsutsui Exp $"); #include #include @@ -74,13 +74,13 @@ static bool ahd_pmf_shutdown(device_t, int); int ahd_attach(struct ahd_softc *ahd) { - int s; + int s; char ahd_info[256]; ahd_controller_info(ahd, ahd_info, sizeof(ahd_info)); - printf("%s: %s\n", device_xname(&ahd->sc_dev), ahd_info); + printf("%s: %s\n", device_xname(&ahd->sc_dev), ahd_info); - ahd_lock(ahd, &s); + ahd_lock(ahd, &s); ahd->sc_adapter.adapt_dev = &ahd->sc_dev; ahd->sc_adapter.adapt_nchannels = 1; @@ -93,12 +93,12 @@ ahd_attach(struct ahd_softc *ahd) ahd->sc_adapter.adapt_request = ahd_action; ahd->sc_channel.chan_adapter = &ahd->sc_adapter; - ahd->sc_channel.chan_bustype = &scsi_bustype; - ahd->sc_channel.chan_channel = 0; - ahd->sc_channel.chan_ntargets = AHD_NUM_TARGETS; - ahd->sc_channel.chan_nluns = 8 /*AHD_NUM_LUNS*/; - ahd->sc_channel.chan_id = ahd->our_id; - ahd->sc_channel.chan_flags |= SCSIPI_CHAN_CANGROW; + ahd->sc_channel.chan_bustype = &scsi_bustype; + ahd->sc_channel.chan_channel = 0; + ahd->sc_channel.chan_ntargets = AHD_NUM_TARGETS; + ahd->sc_channel.chan_nluns = 8 /*AHD_NUM_LUNS*/; + ahd->sc_channel.chan_id = ahd->our_id; + ahd->sc_channel.chan_flags |= SCSIPI_CHAN_CANGROW; ahd->sc_child = config_found((void *)ahd, &ahd->sc_channel, scsiprint); @@ -112,7 +112,7 @@ ahd_attach(struct ahd_softc *ahd) aprint_error_dev(&ahd->sc_dev, "couldn't establish power handler\n"); - ahd_unlock(ahd, &s); + ahd_unlock(ahd, &s); return (1); } @@ -156,21 +156,21 @@ static int ahd_ioctl(struct scsipi_channel *channel, u_long cmd, void *addr, int flag, struct proc *p) { - struct ahd_softc *ahd = (void *)channel->chan_adapter->adapt_dev; - int s, ret = ENOTTY; + struct ahd_softc *ahd = (void *)channel->chan_adapter->adapt_dev; + int s, ret = ENOTTY; - switch (cmd) { - case SCBUSIORESET: - s = splbio(); - ahd_reset_channel(ahd, channel->chan_channel == 1 ? 'B' : 'A', TRUE); - splx(s); - ret = 0; - break; - default: - break; - } + switch (cmd) { + case SCBUSIORESET: + s = splbio(); + ahd_reset_channel(ahd, channel->chan_channel == 1 ? 'B' : 'A', TRUE); + splx(s); + ret = 0; + break; + default: + break; + } - return ret; + return ret; } /* @@ -210,14 +210,14 @@ ahd_done(struct ahd_softc *ahd, struct scb *scb) int op; if (xs->xs_control & XS_CTL_DATA_IN) - op = BUS_DMASYNC_POSTREAD; + op = BUS_DMASYNC_POSTREAD; else - op = BUS_DMASYNC_POSTWRITE; + op = BUS_DMASYNC_POSTWRITE; bus_dmamap_sync(ahd->parent_dmat, scb->dmamap, 0, scb->dmamap->dm_mapsize, op); - bus_dmamap_unload(ahd->parent_dmat, scb->dmamap); - } + bus_dmamap_unload(ahd->parent_dmat, scb->dmamap); + } /* * If the recovery SCB completes, we have to be @@ -235,46 +235,46 @@ ahd_done(struct ahd_softc *ahd, struct scb *scb) struct scsipi_xfer *txs = list_scb->xs; if (!(txs->xs_control & XS_CTL_POLL)) { - callout_reset(&txs->xs_callout, - (txs->timeout > 1000000) ? - (txs->timeout / 1000) * hz : - (txs->timeout * hz) / 1000, - ahd_timeout, list_scb); - } + callout_reset(&txs->xs_callout, + (txs->timeout > 1000000) ? + (txs->timeout / 1000) * hz : + (txs->timeout * hz) / 1000, + ahd_timeout, list_scb); + } } if (ahd_get_transaction_status(scb) != XS_NOERROR) - ahd_set_transaction_status(scb, XS_TIMEOUT); - scsipi_printaddr(xs->xs_periph); + ahd_set_transaction_status(scb, XS_TIMEOUT); + scsipi_printaddr(xs->xs_periph); printf("%s: no longer in timeout, status = %x\n", ahd_name(ahd), xs->status); } if (xs->error != XS_NOERROR) { - /* Don't clobber any existing error state */ + /* Don't clobber any existing error state */ } else if ((xs->status == SCSI_STATUS_BUSY) || (xs->status == SCSI_STATUS_QUEUE_FULL)) { - ahd_set_transaction_status(scb, XS_BUSY); + ahd_set_transaction_status(scb, XS_BUSY); printf("%s: drive (ID %d, LUN %d) queue full (SCB 0x%x)\n", ahd_name(ahd), SCB_GET_TARGET(ahd,scb), SCB_GET_LUN(scb), SCB_GET_TAG(scb)); - } else if ((scb->flags & SCB_SENSE) != 0) { - /* - * We performed autosense retrieval. - * - * zero the sense data before having - * the drive fill it. The SCSI spec mandates - * that any untransferred data should be - * assumed to be zero. Complete the 'bounce' - * of sense information through buffers accessible - * via bus-space by copying it into the clients - * csio. - */ - memset(&xs->sense.scsi_sense, 0, sizeof(xs->sense.scsi_sense)); - memcpy(&xs->sense.scsi_sense, ahd_get_sense_buf(ahd, scb), + } else if ((scb->flags & SCB_SENSE) != 0) { + /* + * We performed autosense retrieval. + * + * zero the sense data before having + * the drive fill it. The SCSI spec mandates + * that any untransferred data should be + * assumed to be zero. Complete the 'bounce' + * of sense information through buffers accessible + * via bus-space by copying it into the clients + * csio. + */ + memset(&xs->sense.scsi_sense, 0, sizeof(xs->sense.scsi_sense)); + memcpy(&xs->sense.scsi_sense, ahd_get_sense_buf(ahd, scb), sizeof(struct scsi_sense_data)); - ahd_set_transaction_status(scb, XS_SENSE); - } else if ((scb->flags & SCB_PKT_SENSE) != 0) { + ahd_set_transaction_status(scb, XS_SENSE); + } else if ((scb->flags & SCB_PKT_SENSE) != 0) { struct scsi_status_iu_header *siu; u_int sense_len; #ifdef AHD_DEBUG @@ -296,28 +296,28 @@ ahd_done(struct ahd_softc *ahd, struct scb *scb) printf(" 0x%x", ((uint8_t *)&xs->sense.scsi_sense)[i]); printf("\n"); #endif - ahd_set_transaction_status(scb, XS_SENSE); + ahd_set_transaction_status(scb, XS_SENSE); } if (scb->flags & SCB_FREEZE_QUEUE) { - scsipi_periph_thaw(periph, 1); - scb->flags &= ~SCB_FREEZE_QUEUE; - } + scsipi_periph_thaw(periph, 1); + scb->flags &= ~SCB_FREEZE_QUEUE; + } - if (scb->flags & SCB_REQUEUE) - ahd_set_transaction_status(scb, XS_REQUEUE); + if (scb->flags & SCB_REQUEUE) + ahd_set_transaction_status(scb, XS_REQUEUE); - ahd_lock(ahd, &s); - ahd_free_scb(ahd, scb); - ahd_unlock(ahd, &s); + ahd_lock(ahd, &s); + ahd_free_scb(ahd, scb); + ahd_unlock(ahd, &s); - scsipi_done(xs); + scsipi_done(xs); } static void ahd_action(struct scsipi_channel *chan, scsipi_adapter_req_t req, void *arg) { - struct ahd_softc *ahd; + struct ahd_softc *ahd; struct ahd_initiator_tinfo *tinfo; struct ahd_tmode_tstate *tstate; @@ -328,25 +328,25 @@ ahd_action(struct scsipi_channel *chan, scsipi_adapter_req_t req, void *arg) case ADAPTER_REQ_RUN_XFER: { struct scsipi_xfer *xs; - struct scsipi_periph *periph; - struct scb *scb; - struct hardware_scb *hscb; + struct scsipi_periph *periph; + struct scb *scb; + struct hardware_scb *hscb; u_int target_id; u_int our_id; u_int col_idx; char channel; int s; - xs = arg; - periph = xs->xs_periph; + xs = arg; + periph = xs->xs_periph; - SC_DEBUG(periph, SCSIPI_DB3, ("ahd_action\n")); + SC_DEBUG(periph, SCSIPI_DB3, ("ahd_action\n")); target_id = periph->periph_target; - our_id = ahd->our_id; - channel = (chan->chan_channel == 1) ? 'B' : 'A'; + our_id = ahd->our_id; + channel = (chan->chan_channel == 1) ? 'B' : 'A'; - /* + /* * get an scb to use. */ ahd_lock(ahd, &s); @@ -526,11 +526,11 @@ ahd_execute_scb(void *arg, bus_dma_segment_t *dm_segs, int nsegments) { struct scb *scb; struct scsipi_xfer *xs; - struct ahd_softc *ahd; + struct ahd_softc *ahd; struct ahd_initiator_tinfo *tinfo; struct ahd_tmode_tstate *tstate; u_int mask; - int s; + int s; scb = (struct scb*)arg; xs = scb->xs; @@ -609,7 +609,7 @@ ahd_execute_scb(void *arg, bus_dma_segment_t *dm_segs, int nsegments) } else #endif if ((tstate->auto_negotiate & mask) != 0) { - scb->flags |= SCB_AUTO_NEGOTIATE; + scb->flags |= SCB_AUTO_NEGOTIATE; scb->hscb->control |= MK_MESSAGE; } @@ -635,21 +635,21 @@ ahd_execute_scb(void *arg, bus_dma_segment_t *dm_segs, int nsegments) } if (!(xs->xs_control & XS_CTL_POLL)) { - ahd_unlock(ahd, &s); - return; - } - /* - * If we can't use interrupts, poll for completion - */ - SC_DEBUG(xs->xs_periph, SCSIPI_DB3, ("cmd_poll\n")); - do { - if (ahd_poll(ahd, xs->timeout)) { - if (!(xs->xs_control & XS_CTL_SILENT)) - printf("cmd fail\n"); - ahd_timeout(scb); - break; - } - } while (!(xs->xs_status & XS_STS_DONE)); + ahd_unlock(ahd, &s); + return; + } + /* + * If we can't use interrupts, poll for completion + */ + SC_DEBUG(xs->xs_periph, SCSIPI_DB3, ("cmd_poll\n")); + do { + if (ahd_poll(ahd, xs->timeout)) { + if (!(xs->xs_control & XS_CTL_SILENT)) + printf("cmd fail\n"); + ahd_timeout(scb); + break; + } + } while (!(xs->xs_status & XS_STS_DONE)); ahd_unlock(ahd, &s); } @@ -659,18 +659,18 @@ ahd_poll(struct ahd_softc *ahd, int wait) { while (--wait) { - DELAY(1000); - if (ahd_inb(ahd, INTSTAT) & INT_PEND) - break; - } + DELAY(1000); + if (ahd_inb(ahd, INTSTAT) & INT_PEND) + break; + } - if (wait == 0) { - printf("%s: board is not responding\n", ahd_name(ahd)); - return (EIO); - } + if (wait == 0) { + printf("%s: board is not responding\n", ahd_name(ahd)); + return (EIO); + } - ahd_intr((void *)ahd); - return (0); + ahd_intr((void *)ahd); + return (0); } @@ -702,10 +702,10 @@ ahd_setup_data(struct ahd_softc *ahd, struct scsipi_xfer *xs, memcpy(hscb->shared_data.idata.cdb, xs->cmd, hscb->cdb_len); /* Only use S/G if there is a transfer */ - if (xs->datalen) { - int error; + if (xs->datalen) { + int error; - error = bus_dmamap_load(ahd->parent_dmat, + error = bus_dmamap_load(ahd->parent_dmat, scb->dmamap, xs->data, xs->datalen, NULL, ((xs->xs_control & XS_CTL_NOSLEEP) ? @@ -713,22 +713,22 @@ ahd_setup_data(struct ahd_softc *ahd, struct scsipi_xfer *xs, BUS_DMA_STREAMING | ((xs->xs_control & XS_CTL_DATA_IN) ? BUS_DMA_READ : BUS_DMA_WRITE)); - if (error) { + if (error) { #ifdef AHD_DEBUG - printf("%s: in ahc_setup_data(): bus_dmamap_load() " + printf("%s: in ahc_setup_data(): bus_dmamap_load() " "= %d\n", ahd_name(ahd), error); #endif - xs->error = XS_RESOURCE_SHORTAGE; - scsipi_done(xs); - return; - } - ahd_execute_scb(scb, + xs->error = XS_RESOURCE_SHORTAGE; + scsipi_done(xs); + return; + } + ahd_execute_scb(scb, scb->dmamap->dm_segs, scb->dmamap->dm_nsegs); - } else { - ahd_execute_scb(scb, NULL, 0); - } + } else { + ahd_execute_scb(scb, NULL, 0); + } } void @@ -821,15 +821,15 @@ void ahd_platform_set_tags(struct ahd_softc *ahd, struct ahd_devinfo *devinfo, ahd_queue_alg alg) { - struct ahd_tmode_tstate *tstate; + struct ahd_tmode_tstate *tstate; - ahd_fetch_transinfo(ahd, devinfo->channel, devinfo->our_scsiid, - devinfo->target, &tstate); + ahd_fetch_transinfo(ahd, devinfo->channel, devinfo->our_scsiid, + devinfo->target, &tstate); - if (alg != AHD_QUEUE_NONE) - tstate->tagenable |= devinfo->target_mask; + if (alg != AHD_QUEUE_NONE) + tstate->tagenable |= devinfo->target_mask; else - tstate->tagenable &= ~devinfo->target_mask; + tstate->tagenable &= ~devinfo->target_mask; } void diff --git a/sys/dev/ic/aic79xx_osm.h b/sys/dev/ic/aic79xx_osm.h index 239f7e3c81c5..0b6ba65d924d 100644 --- a/sys/dev/ic/aic79xx_osm.h +++ b/sys/dev/ic/aic79xx_osm.h @@ -1,4 +1,4 @@ -/* $NetBSD: aic79xx_osm.h,v 1.17 2009/05/12 14:25:17 cegger Exp $ */ +/* $NetBSD: aic79xx_osm.h,v 1.18 2009/09/02 17:08:12 tsutsui Exp $ */ /* * NetBSD platform specific driver option settings, data structures, @@ -32,9 +32,9 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: aic79xx_osm.h,v 1.17 2009/05/12 14:25:17 cegger Exp $ + * $NetBSD: aic79xx_osm.h,v 1.18 2009/09/02 17:08:12 tsutsui Exp $ * - * //depot/aic7xxx/freebsd/dev/aic7xxx/aic79xx_osm.h#19 $$NetBSD: aic79xx_osm.h,v 1.17 2009/05/12 14:25:17 cegger Exp $ + * //depot/aic7xxx/freebsd/dev/aic7xxx/aic79xx_osm.h#19 $$NetBSD: aic79xx_osm.h,v 1.18 2009/09/02 17:08:12 tsutsui Exp $ * * $FreeBSD: src/sys/dev/aic7xxx/aic79xx_osm.h,v 1.9 2003/05/26 21:43:29 gibbs Exp $ */ @@ -86,7 +86,7 @@ #define SIM_PATH(ahd, sim) \ (ahd->platform_data->path) #define BUILD_SCSIID(ahd, sim, target_id, our_id) \ - ((((target_id) << TID_SHIFT) & TID) | (our_id)) + ((((target_id) << TID_SHIFT) & TID) | (our_id)) #define SCB_GET_SIM(ahd, scb) \ @@ -390,7 +390,7 @@ void ahd_set_residual(struct scb *scb, u_long resid) static __inline void ahd_set_sense_residual(struct scb *scb, u_long resid) { - //scb->xs->sense.scsi_sense.extra_len = resid; /* ??? */ + //scb->xs->sense.scsi_sense.extra_len = resid; /* ??? */ } @@ -427,7 +427,7 @@ ahd_release_simq(struct ahd_softc *ahd) static __inline void ahd_freeze_scb(struct scb *scb) { - struct scsipi_xfer *xs = scb->xs; + struct scsipi_xfer *xs = scb->xs; if (!(scb->flags & SCB_FREEZE_QUEUE)) { scsipi_periph_freeze(xs->xs_periph, 1); diff --git a/sys/dev/ic/aic79xxvar.h b/sys/dev/ic/aic79xxvar.h index be23296b642a..1cefebd71333 100644 --- a/sys/dev/ic/aic79xxvar.h +++ b/sys/dev/ic/aic79xxvar.h @@ -832,8 +832,8 @@ struct ahd_tmode_tstate { * to parity errors in each phase table. */ struct ahd_phase_table_entry { - uint8_t phase; - uint8_t mesg_out; /* Message response to parity errors */ + uint8_t phase; + uint8_t mesg_out; /* Message response to parity errors */ const char *phasemsg; }; @@ -1258,7 +1258,7 @@ struct ahd_softc { uint16_t user_discenable;/* Disconnection allowed */ uint16_t user_tagenable;/* Tagged Queuing allowed */ - /* Adapter interrupt routine */ + /* Adapter interrupt routine */ void* ih; struct ahd_pci_busdata *bus_data; };