From owner-svn-src-stable-12@freebsd.org Wed Sep 25 19:48:07 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF143130AC9; Wed, 25 Sep 2019 19:48:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46dpWW4xZxz4NYr; Wed, 25 Sep 2019 19:48:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 735DA1CAB4; Wed, 25 Sep 2019 19:48:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8PJm784043261; Wed, 25 Sep 2019 19:48:07 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PJm70E043260; Wed, 25 Sep 2019 19:48:07 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201909251948.x8PJm70E043260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 25 Sep 2019 19:48:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r352716 - stable/12/sys/cam/scsi X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/cam/scsi X-SVN-Commit-Revision: 352716 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Sep 2019 19:48:07 -0000 Author: avg Date: Wed Sep 25 19:48:07 2019 New Revision: 352716 URL: https://svnweb.freebsd.org/changeset/base/352716 Log: MFC r351601: scsi_cd: whitespace cleanup Modified: stable/12/sys/cam/scsi/scsi_cd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/12/sys/cam/scsi/scsi_cd.c Wed Sep 25 19:46:52 2019 (r352715) +++ stable/12/sys/cam/scsi/scsi_cd.c Wed Sep 25 19:48:07 2019 (r352716) @@ -270,25 +270,25 @@ static int cdsize(struct cam_periph *periph, u_int32_ static int cd6byteworkaround(union ccb *ccb); static int cderror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags); -static int cdreadtoc(struct cam_periph *periph, u_int32_t mode, - u_int32_t start, u_int8_t *data, +static int cdreadtoc(struct cam_periph *periph, u_int32_t mode, + u_int32_t start, u_int8_t *data, u_int32_t len, u_int32_t sense_flags); -static int cdgetmode(struct cam_periph *periph, +static int cdgetmode(struct cam_periph *periph, struct cd_mode_params *data, u_int32_t page); static int cdsetmode(struct cam_periph *periph, struct cd_mode_params *data); -static int cdplay(struct cam_periph *periph, u_int32_t blk, +static int cdplay(struct cam_periph *periph, u_int32_t blk, u_int32_t len); -static int cdreadsubchannel(struct cam_periph *periph, - u_int32_t mode, u_int32_t format, - int track, - struct cd_sub_channel_info *data, +static int cdreadsubchannel(struct cam_periph *periph, + u_int32_t mode, u_int32_t format, + int track, + struct cd_sub_channel_info *data, u_int32_t len); -static int cdplaymsf(struct cam_periph *periph, u_int32_t startm, - u_int32_t starts, u_int32_t startf, - u_int32_t endm, u_int32_t ends, +static int cdplaymsf(struct cam_periph *periph, u_int32_t startm, + u_int32_t starts, u_int32_t startf, + u_int32_t endm, u_int32_t ends, u_int32_t endf); -static int cdplaytracks(struct cam_periph *periph, +static int cdplaytracks(struct cam_periph *periph, u_int32_t strack, u_int32_t sindex, u_int32_t etrack, u_int32_t eindex); static int cdpause(struct cam_periph *periph, u_int32_t go); @@ -599,7 +599,7 @@ cdregister(struct cam_periph *periph, void *arg) M_NOWAIT | M_ZERO); if (softc == NULL) { printf("cdregister: Unable to probe new device. " - "Unable to allocate softc\n"); + "Unable to allocate softc\n"); return(CAM_REQ_CMP_ERR); } @@ -876,7 +876,7 @@ cdstrategy(struct bio *bp) bioq_disksort(&softc->bio_queue, bp); /* - * If we don't know that we have valid media, schedule the media + * If we don't know that we have valid media, schedule the media * check first. The I/O will get executed after the media check. */ if ((softc->flags & CD_FLAG_VALID_MEDIA) == 0) @@ -951,7 +951,6 @@ cdstart(struct cam_periph *periph, union ccb *start_cc } start_ccb->ccb_h.ccb_state = CD_CCB_BUFFER_IO; - LIST_INSERT_HEAD(&softc->pending_ccbs, &start_ccb->ccb_h, periph_links.le); softc->outstanding_cmds++; @@ -1038,7 +1037,7 @@ cdstart(struct cam_periph *periph, union ccb *start_cc break; } - scsi_prevent(&start_ccb->csio, + scsi_prevent(&start_ccb->csio, /*retries*/ cd_retry_count, /*cbfcnp*/ cddone, /*tag_action*/ MSG_SIMPLE_Q_TAG, @@ -1057,7 +1056,7 @@ cdstart(struct cam_periph *periph, union ccb *start_cc } case CD_STATE_MEDIA_TOC_HDR: { struct ioc_toc_header *toch; - + bzero(&softc->toc, sizeof(softc->toc)); toch = &softc->toc.header; @@ -1069,7 +1068,7 @@ cdstart(struct cam_periph *periph, union ccb *start_cc /*byte1_flags*/ 0, /*format*/ SRTOC_FORMAT_TOC, /*track*/ 0, - /*data_ptr*/ (uint8_t *)toch, + /*data_ptr*/ (uint8_t *)toch, /*dxfer_len*/ sizeof(*toch), /*sense_len*/ SSD_FULL_SIZE, /*timeout*/ 50000); @@ -1113,7 +1112,7 @@ cdstart(struct cam_periph *periph, union ccb *start_cc /*byte1_flags*/ CD_MSF, /*format*/ SRTOC_FORMAT_TOC, /*track*/ LEADOUT, - /*data_ptr*/ (uint8_t *)leadout, + /*data_ptr*/ (uint8_t *)leadout, /*dxfer_len*/ sizeof(*leadout), /*sense_len*/ SSD_FULL_SIZE, /*timeout*/ 50000); @@ -1127,7 +1126,7 @@ cdstart(struct cam_periph *periph, union ccb *start_cc static void cddone(struct cam_periph *periph, union ccb *done_ccb) -{ +{ struct cd_softc *softc; struct ccb_scsiio *csio; @@ -1182,7 +1181,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) bp->bio_error = 0; if (bp->bio_resid != 0) { /* - * Short transfer ??? + * Short transfer ??? * XXX: not sure this is correct for partial * transfers at EOM */ @@ -1208,7 +1207,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) bzero(announce_buf, CD_ANNOUNCETMP_SZ); rdcap = (struct scsi_read_capacity_data *)csio->data_ptr; - + cdp->disksize = scsi_4btoul (rdcap->addr) + 1; cdp->blksize = scsi_4btoul (rdcap->length); @@ -1248,7 +1247,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) status = done_ccb->ccb_h.status; - xpt_setup_ccb(&cgd.ccb_h, + xpt_setup_ccb(&cgd.ccb_h, done_ccb->ccb_h.path, CAM_PRIORITY_NORMAL); cgd.ccb_h.func_code = XPT_GDEV_TYPE; @@ -1282,15 +1281,15 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) "size failed: %s, %s", sense_key_desc, asc_desc); - } else if ((have_sense == 0) - && ((status & CAM_STATUS_MASK) == - CAM_SCSI_STATUS_ERROR) - && (csio->scsi_status == - SCSI_STATUS_BUSY)) { - snprintf(announce_buf, + } else if ((have_sense == 0) + && ((status & CAM_STATUS_MASK) == + CAM_SCSI_STATUS_ERROR) + && (csio->scsi_status == + SCSI_STATUS_BUSY)) { + snprintf(announce_buf, CD_ANNOUNCETMP_SZ, - "Attempt to query device " - "size failed: SCSI Status: %s", + "Attempt to query device " + "size failed: SCSI Status: %s", scsi_status_string(csio)); } else if (SID_TYPE(&cgd.inq_data) == T_CDROM) { /* @@ -1301,7 +1300,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) * don't support CDROM commands. * If we have sense information, go * ahead and print it out. - * Otherwise, just say that we + * Otherwise, just say that we * couldn't attach. */ @@ -1354,7 +1353,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) */ taskqueue_enqueue(taskqueue_thread,&softc->sysctl_task); } - softc->state = CD_STATE_NORMAL; + softc->state = CD_STATE_NORMAL; /* * Since our peripheral may be invalidated by an error * above or an external event, we must release our CCB @@ -1386,7 +1385,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) cam_periph_release_locked(periph); return; } - case CD_CCB_MEDIA_ALLOW: + case CD_CCB_MEDIA_ALLOW: case CD_CCB_MEDIA_PREVENT: { int error; @@ -1526,12 +1525,12 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) /* * We will get errors here for media that doesn't have a table - * of contents. According to the MMC-3 spec: "When a Read + * of contents. According to the MMC-3 spec: "When a Read * TOC/PMA/ATIP command is presented for a DDCD/CD-R/RW media, * where the first TOC has not been recorded (no complete * session) and the Format codes 0000b, 0001b, or 0010b are - * specified, this command shall be rejected with an INVALID - * FIELD IN CDB. Devices that are not capable of reading an + * specified, this command shall be rejected with an INVALID + * FIELD IN CDB. Devices that are not capable of reading an * incomplete session on DDC/CD-R/RW media shall report * CANNOT READ MEDIUM - INCOMPATIBLE FORMAT." * @@ -1792,7 +1791,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f M_WAITOK | M_ZERO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("trying to do CDIOCPLAYTRACKS\n")); error = cdgetmode(periph, ¶ms, AUDIO_PAGE); @@ -1838,7 +1837,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f softc->toc.header.starting_track; if ((st < 0) || (et < 0) - || (st > (softc->toc.header.ending_track - + || (st > (softc->toc.header.ending_track - softc->toc.header.starting_track))) { error = EINVAL; cam_periph_unlock(periph); @@ -1888,7 +1887,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f M_WAITOK | M_ZERO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("trying to do CDIOCPLAYMSF\n")); error = cdgetmode(periph, ¶ms, AUDIO_PAGE); @@ -1929,7 +1928,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f M_WAITOK | M_ZERO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("trying to do CDIOCPLAYBLOCKS\n")); @@ -1960,11 +1959,11 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f struct cd_sub_channel_info *data; u_int32_t len = args->data_len; - data = malloc(sizeof(struct cd_sub_channel_info), + data = malloc(sizeof(struct cd_sub_channel_info), M_SCSICD, M_WAITOK | M_ZERO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("trying to do CDIOCREADSUBCHANNEL\n")); if ((len > sizeof(struct cd_sub_channel_info)) || @@ -1988,7 +1987,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f if (error) { free(data, M_SCSICD); cam_periph_unlock(periph); - break; + break; } if (softc->quirks & CD_Q_BCD_TRACKS) data->what.track_info.track_number = @@ -2010,10 +2009,10 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f M_WAITOK | M_ZERO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("trying to do CDIOREADTOCHEADER\n")); - error = cdreadtoc(periph, 0, 0, (u_int8_t *)th, + error = cdreadtoc(periph, 0, 0, (u_int8_t *)th, sizeof (*th), /*sense_flags*/SF_NO_PRINT); if (error) { free(th, M_SCSICD); @@ -2024,7 +2023,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f /* we are going to have to convert the BCD * encoding on the cd to what is expected */ - th->starting_track = + th->starting_track = bcd2bin(th->starting_track); th->ending_track = bcd2bin(th->ending_track); } @@ -2051,7 +2050,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f lead = malloc(sizeof(*lead), M_SCSICD, M_WAITOK | M_ZERO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("trying to do CDIOREADTOCENTRYS\n")); if (te->data_len < sizeof(struct cd_toc_entry) @@ -2068,7 +2067,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f } th = &data->header; - error = cdreadtoc(periph, 0, 0, (u_int8_t *)th, + error = cdreadtoc(periph, 0, 0, (u_int8_t *)th, sizeof (*th), /*sense_flags*/0); if (error) { free(data, M_SCSICD); @@ -2152,7 +2151,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f cam_periph_unlock(periph); break; } - data->entries[idx - starting_track] = + data->entries[idx - starting_track] = lead->entry; } if (softc->quirks & CD_Q_BCD_TRACKS) { @@ -2180,7 +2179,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f data = malloc(sizeof(*data), M_SCSICD, M_WAITOK | M_ZERO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("trying to do CDIOREADTOCENTRY\n")); if (te->address_format != CD_MSF_FORMAT @@ -2249,11 +2248,11 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f union cd_pages *page; params.alloc_len = sizeof(union cd_mode_data_6_10); - params.mode_buf = malloc(params.alloc_len, M_SCSICD, + params.mode_buf = malloc(params.alloc_len, M_SCSICD, M_WAITOK | M_ZERO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("trying to do CDIOCSETPATCH\n")); error = cdgetmode(periph, ¶ms, AUDIO_PAGE); @@ -2264,9 +2263,9 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f } page = cdgetpage(¶ms); - page->audio.port[LEFT_PORT].channels = + page->audio.port[LEFT_PORT].channels = arg->patch[0]; - page->audio.port[RIGHT_PORT].channels = + page->audio.port[RIGHT_PORT].channels = arg->patch[1]; page->audio.port[2].channels = arg->patch[2]; page->audio.port[3].channels = arg->patch[3]; @@ -2282,11 +2281,11 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f union cd_pages *page; params.alloc_len = sizeof(union cd_mode_data_6_10); - params.mode_buf = malloc(params.alloc_len, M_SCSICD, + params.mode_buf = malloc(params.alloc_len, M_SCSICD, M_WAITOK | M_ZERO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("trying to do CDIOCGETVOL\n")); error = cdgetmode(periph, ¶ms, AUDIO_PAGE); @@ -2297,9 +2296,9 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f } page = cdgetpage(¶ms); - arg->vol[LEFT_PORT] = + arg->vol[LEFT_PORT] = page->audio.port[LEFT_PORT].volume; - arg->vol[RIGHT_PORT] = + arg->vol[RIGHT_PORT] = page->audio.port[RIGHT_PORT].volume; arg->vol[2] = page->audio.port[2].volume; arg->vol[3] = page->audio.port[3].volume; @@ -2314,11 +2313,11 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f union cd_pages *page; params.alloc_len = sizeof(union cd_mode_data_6_10); - params.mode_buf = malloc(params.alloc_len, M_SCSICD, + params.mode_buf = malloc(params.alloc_len, M_SCSICD, M_WAITOK | M_ZERO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("trying to do CDIOCSETVOL\n")); error = cdgetmode(periph, ¶ms, AUDIO_PAGE); @@ -2330,10 +2329,10 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f page = cdgetpage(¶ms); page->audio.port[LEFT_PORT].channels = CHANNEL_0; - page->audio.port[LEFT_PORT].volume = + page->audio.port[LEFT_PORT].volume = arg->vol[LEFT_PORT]; page->audio.port[RIGHT_PORT].channels = CHANNEL_1; - page->audio.port[RIGHT_PORT].volume = + page->audio.port[RIGHT_PORT].volume = arg->vol[RIGHT_PORT]; page->audio.port[2].volume = arg->vol[2]; page->audio.port[3].volume = arg->vol[3]; @@ -2352,7 +2351,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f M_WAITOK | M_ZERO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("trying to do CDIOCSETMONO\n")); error = cdgetmode(periph, ¶ms, AUDIO_PAGE); @@ -2363,9 +2362,9 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f } page = cdgetpage(¶ms); - page->audio.port[LEFT_PORT].channels = + page->audio.port[LEFT_PORT].channels = LEFT_CHANNEL | RIGHT_CHANNEL; - page->audio.port[RIGHT_PORT].channels = + page->audio.port[RIGHT_PORT].channels = LEFT_CHANNEL | RIGHT_CHANNEL; page->audio.port[2].channels = 0; page->audio.port[3].channels = 0; @@ -2384,7 +2383,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f M_WAITOK | M_ZERO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("trying to do CDIOCSETSTEREO\n")); error = cdgetmode(periph, ¶ms, AUDIO_PAGE); @@ -2395,9 +2394,9 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f } page = cdgetpage(¶ms); - page->audio.port[LEFT_PORT].channels = + page->audio.port[LEFT_PORT].channels = LEFT_CHANNEL; - page->audio.port[RIGHT_PORT].channels = + page->audio.port[RIGHT_PORT].channels = RIGHT_CHANNEL; page->audio.port[2].channels = 0; page->audio.port[3].channels = 0; @@ -2416,7 +2415,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f M_WAITOK | M_ZERO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("trying to do CDIOCSETMUTE\n")); error = cdgetmode(periph, ¶ms, AUDIO_PAGE); @@ -2446,7 +2445,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f M_WAITOK | M_ZERO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("trying to do CDIOCSETLEFT\n")); error = cdgetmode(periph, ¶ms, AUDIO_PAGE); @@ -2476,7 +2475,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f M_WAITOK | M_ZERO); cam_periph_lock(periph); - CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, + CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, ("trying to do CDIOCSETRIGHT\n")); error = cdgetmode(periph, ¶ms, AUDIO_PAGE); @@ -2598,7 +2597,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f cam_periph_lock(periph); cam_periph_unhold(periph); - + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("leaving cdioctl\n")); if (error && bootverbose) { printf("scsi_cd.c::ioctl cmd=%08lx error=%d\n", cmd, error); @@ -2618,24 +2617,24 @@ cdprevent(struct cam_periph *periph, int action) CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering cdprevent\n")); softc = (struct cd_softc *)periph->softc; - + if (((action == PR_ALLOW) && (softc->flags & CD_FLAG_DISC_LOCKED) == 0) || ((action == PR_PREVENT) && (softc->flags & CD_FLAG_DISC_LOCKED) != 0)) { return; } - + ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); - scsi_prevent(&ccb->csio, + scsi_prevent(&ccb->csio, /*retries*/ cd_retry_count, /*cbfcnp*/NULL, MSG_SIMPLE_Q_TAG, action, SSD_FULL_SIZE, /* timeout */60000); - + error = cdrunccb(ccb, cderror, /*cam_flags*/CAM_RETRY_SELTO, /*sense_flags*/SF_RETRY_UA|SF_NO_PRINT); @@ -2692,7 +2691,7 @@ cdcheckmedia(struct cam_periph *periph, int do_wait) goto bailout; error = msleep(&softc->toc, cam_periph_mtx(periph), PRIBIO,"cdmedia",0); - + if (error != 0) goto bailout; @@ -2807,7 +2806,7 @@ cdcheckmedia(struct cam_periph *periph) cdindex = toch->starting_track + num_entries -1; if (cdindex == toch->ending_track + 1) { - error = cdreadtoc(periph, CD_MSF_FORMAT, LEADOUT, + error = cdreadtoc(periph, CD_MSF_FORMAT, LEADOUT, (u_int8_t *)&leadout, sizeof(leadout), SF_NO_PRINT); if (error != 0) { @@ -2860,16 +2859,16 @@ cdsize(struct cam_periph *periph, u_int32_t *size) CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering cdsize\n")); softc = (struct cd_softc *)periph->softc; - + ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); /* XXX Should be M_WAITOK */ - rcap_buf = malloc(sizeof(struct scsi_read_capacity_data), + rcap_buf = malloc(sizeof(struct scsi_read_capacity_data), M_SCSICD, M_NOWAIT | M_ZERO); if (rcap_buf == NULL) return (ENOMEM); - scsi_read_capacity(&ccb->csio, + scsi_read_capacity(&ccb->csio, /*retries*/ cd_retry_count, /*cbfcnp*/NULL, MSG_SIMPLE_Q_TAG, @@ -2969,9 +2968,9 @@ cd6byteworkaround(union ccb *ccb) ms6 = (struct scsi_mode_sense_6 *)cdb; bzero(&ms10, sizeof(ms10)); - ms10.opcode = MODE_SENSE_10; - ms10.byte2 = ms6->byte2; - ms10.page = ms6->page; + ms10.opcode = MODE_SENSE_10; + ms10.byte2 = ms6->byte2; + ms10.page = ms6->page; /* * 10 byte mode header, block descriptor, @@ -3124,8 +3123,8 @@ cdmediapoll(void *arg) /* * Read table of contents */ -static int -cdreadtoc(struct cam_periph *periph, u_int32_t mode, u_int32_t start, +static int +cdreadtoc(struct cam_periph *periph, u_int32_t mode, u_int32_t start, u_int8_t *data, u_int32_t len, u_int32_t sense_flags) { u_int32_t ntoc; @@ -3141,7 +3140,7 @@ cdreadtoc(struct cam_periph *periph, u_int32_t mode, u csio = &ccb->csio; scsi_read_toc(csio, - /* retries */ cd_retry_count, + /* retries */ cd_retry_count, /* cbfcnp */ NULL, /* tag_action */ MSG_SIMPLE_Q_TAG, /* byte1_flags */ (mode == CD_MSF_FORMAT) ? CD_MSF : 0, @@ -3161,9 +3160,9 @@ cdreadtoc(struct cam_periph *periph, u_int32_t mode, u } static int -cdreadsubchannel(struct cam_periph *periph, u_int32_t mode, - u_int32_t format, int track, - struct cd_sub_channel_info *data, u_int32_t len) +cdreadsubchannel(struct cam_periph *periph, u_int32_t mode, + u_int32_t format, int track, + struct cd_sub_channel_info *data, u_int32_t len) { struct scsi_read_subchannel *scsi_cmd; struct ccb_scsiio *csio; @@ -3176,8 +3175,8 @@ cdreadsubchannel(struct cam_periph *periph, u_int32_t csio = &ccb->csio; - cam_fill_csio(csio, - /* retries */ cd_retry_count, + cam_fill_csio(csio, + /* retries */ cd_retry_count, /* cbfcnp */ NULL, /* flags */ CAM_DIR_IN, /* tag_action */ MSG_SIMPLE_Q_TAG, @@ -3185,7 +3184,7 @@ cdreadsubchannel(struct cam_periph *periph, u_int32_t /* dxfer_len */ len, /* sense_len */ SSD_FULL_SIZE, sizeof(struct scsi_read_subchannel), - /* timeout */ 50000); + /* timeout */ 50000); scsi_cmd = (struct scsi_read_subchannel *)&csio->cdb_io.cdb_bytes; bzero (scsi_cmd, sizeof(*scsi_cmd)); @@ -3406,7 +3405,7 @@ cdsetmode(struct cam_periph *periph, struct cd_mode_pa } -static int +static int cdplay(struct cam_periph *periph, u_int32_t blk, u_int32_t len) { struct ccb_scsiio *csio; @@ -3476,8 +3475,8 @@ cdplaymsf(struct cam_periph *periph, u_int32_t startm, csio = &ccb->csio; - cam_fill_csio(csio, - /* retries */ cd_retry_count, + cam_fill_csio(csio, + /* retries */ cd_retry_count, /* cbfcnp */ NULL, /* flags */ CAM_DIR_NONE, /* tag_action */ MSG_SIMPLE_Q_TAG, @@ -3485,7 +3484,7 @@ cdplaymsf(struct cam_periph *periph, u_int32_t startm, /* dxfer_len */ 0, /* sense_len */ SSD_FULL_SIZE, sizeof(struct scsi_play_msf), - /* timeout */ 50000); + /* timeout */ 50000); scsi_cmd = (struct scsi_play_msf *)&csio->cdb_io.cdb_bytes; bzero (scsi_cmd, sizeof(*scsi_cmd)); @@ -3496,11 +3495,11 @@ cdplaymsf(struct cam_periph *periph, u_int32_t startm, scsi_cmd->start_f = startf; scsi_cmd->end_m = endm; scsi_cmd->end_s = ends; - scsi_cmd->end_f = endf; + scsi_cmd->end_f = endf; error = cdrunccb(ccb, cderror, /*cam_flags*/CAM_RETRY_SELTO, /*sense_flags*/SF_RETRY_UA); - + xpt_release_ccb(ccb); return(error); @@ -3522,8 +3521,8 @@ cdplaytracks(struct cam_periph *periph, u_int32_t stra csio = &ccb->csio; - cam_fill_csio(csio, - /* retries */ cd_retry_count, + cam_fill_csio(csio, + /* retries */ cd_retry_count, /* cbfcnp */ NULL, /* flags */ CAM_DIR_NONE, /* tag_action */ MSG_SIMPLE_Q_TAG, @@ -3531,7 +3530,7 @@ cdplaytracks(struct cam_periph *periph, u_int32_t stra /* dxfer_len */ 0, /* sense_len */ SSD_FULL_SIZE, sizeof(struct scsi_play_track), - /* timeout */ 50000); + /* timeout */ 50000); scsi_cmd = (struct scsi_play_track *)&csio->cdb_io.cdb_bytes; bzero (scsi_cmd, sizeof(*scsi_cmd)); @@ -3564,8 +3563,8 @@ cdpause(struct cam_periph *periph, u_int32_t go) csio = &ccb->csio; - cam_fill_csio(csio, - /* retries */ cd_retry_count, + cam_fill_csio(csio, + /* retries */ cd_retry_count, /* cbfcnp */ NULL, /* flags */ CAM_DIR_NONE, /* tag_action */ MSG_SIMPLE_Q_TAG, @@ -3573,7 +3572,7 @@ cdpause(struct cam_periph *periph, u_int32_t go) /* dxfer_len */ 0, /* sense_len */ SSD_FULL_SIZE, sizeof(struct scsi_pause), - /* timeout */ 50000); + /* timeout */ 50000); scsi_cmd = (struct scsi_pause *)&csio->cdb_io.cdb_bytes; bzero (scsi_cmd, sizeof(*scsi_cmd)); @@ -3672,7 +3671,7 @@ cdsetspeed(struct cam_periph *periph, u_int32_t rdspee /* dxfer_len */ 0, /* sense_len */ SSD_FULL_SIZE, sizeof(struct scsi_set_speed), - /* timeout */ 50000); + /* timeout */ 50000); scsi_cmd = (struct scsi_set_speed *)&csio->cdb_io.cdb_bytes; bzero(scsi_cmd, sizeof(*scsi_cmd)); @@ -4095,7 +4094,7 @@ cdreaddvdstructure(struct cam_periph *periph, struct d * Tell the user what the overall length is, no matter * what we can actually fit in the data buffer. */ - dvdstruct->length = length - ccb->csio.resid - + dvdstruct->length = length - ccb->csio.resid - sizeof(struct scsi_read_dvd_struct_data_header); /* @@ -4233,8 +4232,8 @@ scsi_read_toc(struct ccb_scsiio *csio, uint32_t retrie scsi_cmd->from_track = track; scsi_ulto2b(dxfer_len, scsi_cmd->data_len); - cam_fill_csio(csio, - /* retries */ retries, + cam_fill_csio(csio, + /* retries */ retries, /* cbfcnp */ cbfcnp, /* flags */ CAM_DIR_IN, /* tag_action */ tag_action, @@ -4242,5 +4241,5 @@ scsi_read_toc(struct ccb_scsiio *csio, uint32_t retrie /* dxfer_len */ dxfer_len, /* sense_len */ sense_len, sizeof(*scsi_cmd), - /* timeout */ timeout); + /* timeout */ timeout); }