drv_jvc.c
上传用户:xiejiait
上传日期:2007-01-06
资源大小:881k
文件大小:35k
- /** @(#)drv_jvc.c 1.46 99/10/17 Copyright 1997 J. Schilling */
- #ifndef lint
- static char sccsid[] =
- "@(#)drv_jvc.c 1.46 99/10/17 Copyright 1997 J. Schilling";
- #endif
- /*
- * CDR device implementation for
- * JVC/TEAC
- *
- * Copyright (c) 1997 J. Schilling
- */
- /*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- */
- /*#define XXDEBUG*/
- /*#define XXBUFFER*/
- #include <mconfig.h>
- #include <stdio.h>
- #include <standard.h>
- #include <fctldefs.h>
- #include <errno.h>
- #include <strdefs.h>
- #include <unixstd.h>
- #ifdef XXDEBUG
- #include <stdxlib.h>
- #endif
- #include <utypes.h>
- #include <btorder.h>
- #include <intcvt.h>
- #include <scg/scgcmd.h>
- #include <scg/scsidefs.h>
- #include <scg/scsireg.h>
- #include <scg/scsitransp.h>
- #include "cdrecord.h"
- /* just a hack */
- long lba_addr;
- BOOL last_done;
- /*
- * macros for building MSF values from LBA
- */
- #define LBA_MIN(x) ((x)/(60*75))
- #define LBA_SEC(x) (((x)%(60*75))/75)
- #define LBA_FRM(x) ((x)%75)
- #define MSF_CONV(a) ((((a)%100)/10)*16 + ((a)%10))
- extern int lverbose;
- #if defined(_BIT_FIELDS_LTOH) /* Intel byteorder */
- struct teac_mode_page_21 { /* teac dummy selection */
- MP_P_CODE; /* parsave & pagecode */
- u_char p_len; /* 0x01 = 1 Byte */
- Ucbit dummy : 2;
- Ucbit res : 6;
- };
- #else
- struct teac_mode_page_21 { /* teac dummy selection */
- MP_P_CODE; /* parsave & pagecode */
- u_char p_len; /* 0x01 = 1 Byte */
- Ucbit res : 6;
- Ucbit dummy : 2;
- };
- #endif
- struct teac_mode_page_31 { /* teac speed selection */
- MP_P_CODE; /* parsave & pagecode */
- u_char p_len; /* 0x02 = 2 Byte */
- u_char speed;
- u_char res;
- };
- struct cdd_52x_mode_data {
- struct scsi_mode_header header;
- union cdd_pagex {
- struct teac_mode_page_21 teac_page21;
- struct teac_mode_page_31 teac_page31;
- } pagex;
- };
- #if defined(_BIT_FIELDS_LTOH) /* Intel byteorder */
- struct pgm_subcode { /* subcode for progam area */
- u_char subcode;
- Ucbit addr : 4;
- Ucbit control : 4;
- u_char track;
- u_char index;
- };
- #else
- struct pgm_subcode { /* subcode for progam area */
- u_char subcode;
- Ucbit control : 4;
- Ucbit addr : 4;
- u_char track;
- u_char index;
- };
- #endif
- #define set_pgm_subcode(sp, t, c, a, tr, idx) (
- (sp)->subcode = (t),
- (sp)->control = (c),
- (sp)->addr = (a),
- (sp)->track = MSF_CONV(tr),
- (sp)->index = (idx))
- #define SC_P 1 /* Subcode defines pre-gap (Pause) */
- #define SC_TR 0 /* Subcode defines track data */
- #if defined(_BIT_FIELDS_LTOH) /* Intel byteorder */
- typedef struct lin_subcode { /* subcode for lead in area */
- Ucbit addr : 4;
- Ucbit control : 4;
- u_char track;
- u_char msf[3];
- } lsc_t;
- #else
- typedef struct lin_subcode { /* subcode for lead in area */
- Ucbit control : 4;
- Ucbit addr : 4;
- u_char track;
- u_char msf[3];
- } lsc_t;
- #endif
- #define set_toc_subcode(sp, c, a, tr, bno) (
- ((lsc_t *)sp)->control = (c),
- ((lsc_t *)sp)->addr = (a),
- ((lsc_t *)sp)->track = MSF_CONV(tr),
- ((lsc_t *)sp)->msf[0] = MSF_CONV(LBA_MIN(bno)),
- ((lsc_t *)sp)->msf[1] = MSF_CONV(LBA_SEC(bno)),
- ((lsc_t *)sp)->msf[2] = MSF_CONV(LBA_FRM(bno)),
- &((lsc_t *)sp)->msf[3])
- #define set_lin_subcode(sp, c, a, pt, min, sec, frm) (
- ((lsc_t *)sp)->control = (c),
- ((lsc_t *)sp)->addr = (a),
- ((lsc_t *)sp)->track = (pt),
- ((lsc_t *)sp)->msf[0] = (min),
- ((lsc_t *)sp)->msf[1] = (sec),
- ((lsc_t *)sp)->msf[2] = (frm),
- &((lsc_t *)sp)->msf[3])
- #if defined(_BIT_FIELDS_LTOH) /* Intel byteorder */
- struct upc_subcode { /* subcode for upc/bar code */
- u_char res;
- Ucbit addr : 4;
- Ucbit control : 4;
- u_char upc[13];
- };
- #else
- struct upc_subcode { /* subcode for upc/bar code */
- u_char res;
- Ucbit control : 4;
- Ucbit addr : 4;
- u_char upc[13];
- };
- #endif
- #if defined(_BIT_FIELDS_LTOH) /* Intel byteorder */
- struct isrc_subcode { /* subcode for ISRC code */
- u_char res;
- Ucbit addr : 4;
- Ucbit control : 4;
- u_char isrc[12];
- u_char res14;
- };
- #else
- struct isrc_subcode { /* subcode for ISRC code */
- u_char res;
- Ucbit control : 4;
- Ucbit addr : 4;
- u_char isrc[12];
- u_char res14;
- };
- #endif
- LOCAL int teac_attach __PR((SCSI *scgp, cdr_t *dp));
- LOCAL int teac_getdisktype __PR((SCSI *scgp, cdr_t *dp, dstat_t *dsp));
- LOCAL int speed_select_teac __PR((SCSI *scgp, int *speedp, int dummy));
- LOCAL int select_secsize_teac __PR((SCSI *scgp, track_t *trackp));
- LOCAL int next_wr_addr_jvc __PR((SCSI *scgp, int track, track_t *, long *ap));
- LOCAL int write_teac_xg1 __PR((SCSI *scgp, caddr_t, long, long, int, BOOL));
- LOCAL int cdr_write_teac __PR((SCSI *scgp, caddr_t bp, long sectaddr, long size, int blocks, BOOL islast));
- LOCAL int open_track_jvc __PR((SCSI *scgp, cdr_t *dp, int track, track_t *trackp));
- LOCAL int teac_fixation __PR((SCSI *scgp, int onp, int dummy, int toctype, int tracks, track_t *trackp));
- LOCAL int close_track_teac __PR((SCSI *scgp, int track, track_t *trackp));
- LOCAL int teac_open_session __PR((SCSI *scgp, int tracks, track_t *trackp, int toctype, int multi));
- LOCAL int teac_calibrate __PR((SCSI *scgp, int toctype, int multi));
- LOCAL int opt_power_judge __PR((SCSI *scgp, int judge));
- LOCAL int clear_subcode __PR((SCSI *scgp));
- LOCAL int set_limits __PR((SCSI *scgp, long lba, long length));
- LOCAL int set_subcode __PR((SCSI *scgp, u_char *subcode_data, int length));
- LOCAL int read_disk_info_teac __PR((SCSI *scgp, u_char *data, int length, int type));
- LOCAL int teac_freeze __PR((SCSI *scgp, int bp_flag));
- LOCAL int teac_wr_pma __PR((SCSI *scgp));
- LOCAL int teac_rd_pma __PR((SCSI *scgp));
- LOCAL int next_wr_addr_teac __PR((SCSI *scgp, long start_lba, long last_lba));
- LOCAL int blank_jvc __PR((SCSI *scgp, long addr, int blanktype));
- LOCAL int buf_cap_teac __PR((SCSI *scgp, long *sp, long *fp));
- LOCAL long read_peak_buffer_cap_teac __PR((SCSI *scgp));
- LOCAL int buffer_inquiry_teac __PR((SCSI *scgp, int fmt));
- #ifdef XXBUFFER
- LOCAL void check_buffer_teac __PR((SCSI *scgp));
- #endif
- #ifdef XXDEBUG
- LOCAL void xxtest_teac __PR((SCSI *scgp));
- #endif
- cdr_t cdr_teac_cdr50 = {
- 0,
- CDR_TAO|CDR_DAO|CDR_SWABAUDIO|CDR_NO_LOLIMIT,
- "teac_cdr50",
- "driver for Teac CD-R50S, Teac CD-R55S, JVC XR-W2010, Pinnacle RCD-5020",
- 0,
- drive_identify,
- teac_attach,
- teac_getdisktype,
- scsi_load,
- scsi_unload,
- buf_cap_teac,
- (int(*)__PR((SCSI *)))cmd_dummy, /* recovery_needed */
- (int(*)__PR((SCSI *, int)))cmd_dummy, /* recover */
- speed_select_teac,
- select_secsize,
- next_wr_addr_jvc,
- (int(*)__PR((SCSI *, Ulong)))cmd_ill, /* reserve_track */
- cdr_write_teac,
- no_sendcue,
- open_track_jvc,
- close_track_teac,
- teac_open_session,
- cmd_dummy,
- read_session_offset_philips,
- teac_fixation,
- /* blank_dummy,*/
- blank_jvc,
- };
- LOCAL int
- teac_getdisktype(scgp, dp, dsp)
- SCSI *scgp;
- cdr_t *dp;
- dstat_t *dsp;
- {
- struct scsi_mode_data md;
- int count = sizeof(struct scsi_mode_header) +
- sizeof(struct scsi_mode_blockdesc);
- int len;
- int page = 0;
- long l;
- fillbytes((caddr_t)&md, sizeof(md), ' ');
- (void)test_unit_ready(scgp);
- if (mode_sense(scgp, (u_char *)&md, count, page, 0) < 0) { /* Page n current */
- return (-1);
- } else {
- len = ((struct scsi_mode_header *)&md)->sense_data_len + 1;
- }
- if (((struct scsi_mode_header *)&md)->blockdesc_len < 8)
- return (-1);
- l = a_to_u_3_byte(md.blockdesc.nlblock);
- dsp->ds_maxblocks = l;
- return (0);
- }
- LOCAL int
- speed_select_teac(scgp, speedp, dummy)
- SCSI *scgp;
- int *speedp;
- int dummy;
- {
- struct cdd_52x_mode_data md;
- int count;
- int status;
- int speed = 1;
- if (speedp)
- speed = *speedp;
- fillbytes((caddr_t)&md, sizeof(md), ' ');
- count = sizeof(struct scsi_mode_header) +
- sizeof(struct teac_mode_page_21);
- md.pagex.teac_page21.p_code = 0x21;
- md.pagex.teac_page21.p_len = 0x01;
- md.pagex.teac_page21.dummy = dummy?3:0;
- status = mode_select(scgp, (u_char *)&md, count, 0, scgp->inq->data_format >= 2);
- if (status < 0)
- return (status);
- if (speedp == 0)
- return (0);
- fillbytes((caddr_t)&md, sizeof(md), ' ');
- count = sizeof(struct scsi_mode_header) +
- sizeof(struct teac_mode_page_31);
- speed >>= 1;
- md.pagex.teac_page31.p_code = 0x31;
- md.pagex.teac_page31.p_len = 0x02;
- md.pagex.teac_page31.speed = speed;
- return (mode_select(scgp, (u_char *)&md, count, 0, scgp->inq->data_format >= 2));
- }
- LOCAL int
- select_secsize_teac(scgp, trackp)
- SCSI *scgp;
- track_t *trackp;
- {
- struct scsi_mode_data md;
- int count = sizeof(struct scsi_mode_header) +
- sizeof(struct scsi_mode_blockdesc);
- int len;
- int page = 0;
- fillbytes((caddr_t)&md, sizeof(md), ' ');
- (void)test_unit_ready(scgp);
- if (mode_sense(scgp, (u_char *)&md, count, page, 0) < 0) { /* Page n current */
- return (-1);
- } else {
- len = ((struct scsi_mode_header *)&md)->sense_data_len + 1;
- }
- if (((struct scsi_mode_header *)&md)->blockdesc_len < 8)
- return (-1);
- md.header.sense_data_len = 0;
- md.header.blockdesc_len = 8;
- md.blockdesc.density = 1;
- if (trackp->secsize == 2352)
- md.blockdesc.density = 4;
- i_to_3_byte(md.blockdesc.lblen, trackp->secsize);
-
- return (mode_select(scgp, (u_char *)&md, count, 0, scgp->inq->data_format >= 2));
- }
- LOCAL int
- next_wr_addr_jvc(scgp, track, trackp, ap)
- SCSI *scgp;
- int track;
- track_t *trackp;
- long *ap;
- {
- if (track > 0) {
- *ap = lba_addr;
- } else {
- long nwa;
- if (read_B0(scgp, TRUE, &nwa, NULL) < 0)
- return (-1);
- *ap = nwa + 150;
- }
- return (0);
- }
- LOCAL int
- write_teac_xg1(scgp, bp, sectaddr, size, blocks, extwr)
- SCSI *scgp;
- caddr_t bp; /* address of buffer */
- long sectaddr; /* disk address (sector) to put */
- long size; /* number of bytes to transfer */
- int blocks; /* sector count */
- BOOL extwr; /* is an extended write */
- {
- register struct scg_cmd *scmd = scgp->scmd;
- fillbytes((caddr_t)scmd, sizeof(*scmd), ' ');
- scmd->addr = bp;
- scmd->size = size;
- scmd->flags = SCG_DISRE_ENA|SCG_CMD_RETRY;
- /* scmd->flags = SCG_DISRE_ENA;*/
- scmd->cdb_len = SC_G1_CDBLEN;
- scmd->sense_len = CCS_SENSE_LEN;
- scmd->target = scgp->target;
- scmd->cdb.g1_cdb.cmd = SC_EWRITE;
- scmd->cdb.g1_cdb.lun = scgp->lun;
- g1_cdbaddr(&scmd->cdb.g1_cdb, sectaddr);
- g1_cdblen(&scmd->cdb.g1_cdb, blocks);
- scmd->cdb.g1_cdb.vu_97 = extwr;
- scgp->cmdname = "write_teac_g1";
- if (scsicmd(scgp) < 0)
- return (-1);
- return (size - scsigetresid(scgp));
- }
- LOCAL int
- cdr_write_teac(scgp, bp, sectaddr, size, blocks, islast)
- SCSI *scgp;
- caddr_t bp; /* address of buffer */
- long sectaddr; /* disk address (sector) to put */
- long size; /* number of bytes to transfer */
- int blocks; /* sector count */
- BOOL islast; /* last write for track */
- {
- int ret;
- if (islast)
- last_done = TRUE;
- ret = write_teac_xg1(scgp, bp, sectaddr, size, blocks, !islast);
- if (ret < 0)
- return (ret);
- lba_addr = sectaddr + blocks;
- #ifdef XXBUFFER
- check_buffer_teac(scgp);
- #endif
- return (ret);
- }
- LOCAL int
- open_track_jvc(scgp, dp, track, trackp)
- SCSI *scgp;
- cdr_t *dp;
- int track;
- track_t *trackp;
- {
- int status;
- long blocks;
- long pregapsize;
- struct pgm_subcode sc;
- last_done = FALSE;
- if (select_secsize_teac(scgp, trackp) < 0)
- return (-1);
- status = clear_subcode(scgp);
- /*next_wr_addr_teac(scgp);*/
- if (status < 0)
- return (status);
- if (trackp->pregapsize != 0) {
- if (lverbose > 1) {
- printf("set_limits(%ld, %ld)-> %ldn",
- lba_addr, trackp->pregapsize, lba_addr + trackp->pregapsize);
- }
- status = set_limits(scgp, lba_addr, trackp->pregapsize);
- if (status < 0)
- return (status);
- /*
- * Set pre-gap (pause - index 0)
- */
- set_pgm_subcode(&sc, SC_P,
- st2mode[trackp->sectype&ST_MASK], ADR_POS, track, 0);
- if (lverbose > 1)
- scsiprbytes("Subcode:", (u_char *)&sc, sizeof(sc));
- status = set_subcode(scgp, (u_char *)&sc, sizeof(sc));
- if (status < 0)
- return (status);
- pregapsize = trackp->pregapsize;
- if (!is_audio(trackp)) {
- lba_addr += 5; /* link & run in blocks */
- pregapsize -= 5;
- }
- if (lverbose > 1) {
- printf("pad_track(%ld, %ld)-> %ldn",
- lba_addr, pregapsize, lba_addr + pregapsize);
- }
- if (pad_track(scgp, dp, track, trackp,
- lba_addr, pregapsize*trackp->secsize,
- FALSE, (long *)0) < 0)
- return (-1);
- }
- blocks = trackp->tracksize/trackp->secsize +
- (trackp->tracksize%trackp->secsize?1:0);
- blocks += trackp->padsize/trackp->secsize +
- (trackp->padsize%trackp->secsize?1:0);
- if (blocks < 300)
- blocks = 300;
- if (!is_audio(trackp))
- blocks += 2;
- if (!is_last(trackp) && trackp[1].pregapsize == 0)
- blocks -= 150;
- /*
- * set the limits for the new subcode - seems to apply to all
- * of the data track.
- * Unknown tracksize is handled in open_session.
- * We definitely need to know the tracksize in this driver.
- */
- if (lverbose > 1) {
- printf("set_limits(%ld, %ld)-> %ldn",
- lba_addr, blocks, lba_addr + blocks);
- }
- status = set_limits(scgp, lba_addr, blocks);
- if (status < 0)
- return (status);
- /*
- * Set track start (index 1)
- */
- set_pgm_subcode(&sc, SC_TR,
- st2mode[trackp->sectype&ST_MASK], ADR_POS, track, 1);
- if (lverbose > 1)
- scsiprbytes("Subcode:", (u_char *)&sc, sizeof(sc));
- status = set_subcode(scgp, (u_char *)&sc, sizeof(sc));
- if (status < 0)
- return (status);
- if (!is_last(trackp) && trackp[1].pregapsize == 0) {
- blocks += lba_addr;
- pregapsize = 150;
- if (lverbose > 1) {
- printf("set_limits(%ld, %ld)-> %ldn",
- blocks, pregapsize, blocks + pregapsize);
- }
- status = set_limits(scgp, blocks, pregapsize);
- if (status < 0)
- return (status);
- /*
- * Set pre-gap (pause - index 0)
- */
- track++;
- trackp++;
- set_pgm_subcode(&sc, SC_P,
- st2mode[trackp->sectype&ST_MASK], ADR_POS, track, 0);
- if (lverbose > 1)
- scsiprbytes("Subcode:", (u_char *)&sc, sizeof(sc));
- status = set_subcode(scgp, (u_char *)&sc, sizeof(sc));
- if (status < 0)
- return (status);
- }
- return (status);
- }
- LOCAL char sector[3000];
- LOCAL int
- close_track_teac(scgp, track, trackp)
- SCSI *scgp;
- int track;
- track_t *trackp;
- {
- int ret = 0;
- if (!last_done) {
- printf("WARNING: adding dummy block to close track.n");
- /*
- * need read sector size
- * XXX do we really need this ?
- * XXX if we need this can we set blocks to 0 ?
- */
- ret = write_teac_xg1(scgp, sector, lba_addr, 2352, 1, FALSE);
- lba_addr++;
- }
- if (!is_audio(trackp))
- lba_addr += 2;
- teac_wr_pma(scgp);
- return (ret);
- }
- static const char *sd_teac50_error_str[] = {
- "100200diagnostic failure on component parts", /* 40 80 */
- "100201diagnostic failure on memories", /* 40 81 */
- "100202diagnostic failure on cd-rom ecc circuit", /* 40 82 */
- "100203diagnostic failure on gate array", /* 40 83 */
- "100204diagnostic failure on internal SCSI controller", /* 40 84 */
- "100205diagnostic failure on servo processor", /* 40 85 */
- "100206diagnostic failure on program rom", /* 40 86 */
- "100220thermal sensor failure", /* 40 90 */
- "200 00controller prom error", /* 80 00 */ /* JVC */
- "201 00no disk present - couldn't get focus", /* 81 00 */ /* JVC */
- "202 00no cartridge present", /* 82 00 */ /* JVC */
- "203 00unable to spin up", /* 83 00 */ /* JVC */
- "204 00addr exceeded the last valid block addr", /* 84 00 */ /* JVC */
- "205 00sync error", /* 85 00 */ /* JVC */
- "206 00address can't find or not data track", /* 86 00 */ /* JVC */
- "207 00missing track", /* 87 00 */ /* JVC */
- "213 00cartridge could not be ejected", /* 8B 00 */ /* JVC */
- "215 00audio not playing", /* 8D 00 */ /* JVC */
- "216 00read toc error", /* 8E 00 */ /* JVC */
- "217 00a blank disk is detected by read toc", /* 8F 00 */
- "220 00pma less disk - not a recordable disk", /* 90 00 */
- "223 00mount error", /* 93 00 */ /* JVC */
- "224 00toc less disk", /* 94 00 */
- "225 00disc information less disk", /* 95 00 */ /* JVC */
- "226 00disc information read error", /* 96 00 */ /* JVC */
- "227 00linear velocity measurement error", /* 97 00 */ /* JVC */
- "230 00drive sequence stop", /* 98 00 */ /* JVC */
- "231 00actuator velocity control error", /* 99 00 */ /* JVC */
- "232 00slider velocity control error", /* 9A 00 */ /* JVC */
- "233 00opc initialize error", /* 9B 00 */
- "233 01power calibration not executed", /* 9B 01 */
- "234 00opc execution eror", /* 9C 00 */
- "234 01alpc error - opc execution", /* 9C 01 */
- "234 02opc execution timeout", /* 9C 02 */
- "245 00disk application code does not match host application code", /* A5 00 */
- "255 00completed preview write", /* AD 00 */
- "256 00invalid B0 value", /* AE 00 */ /* JVC */
- "257 00pca area full", /* AF 00 */
- "260 00efm isn't detected", /* B0 00 */ /* JVC */
- "263 00no logical sector", /* B3 00 */ /* JVC */
- "264 00full pma area", /* B4 00 */
- "265 00read address is atip area - blank", /* B5 00 */
- "266 00write address is efm area - aleady written", /* B6 00 */
- "271 00abnormal spinning - servo irq", /* B9 00 */ /* JVC */
- "272 00no write data - buffer empty", /* BA 00 */
- "273 00write emergency occurred", /* BB 00 */
- "274 00read timeout", /* BC 00 */ /* JVC */
- "277 00abnormal spin - nmi", /* BF 00 */ /* JVC */
- "301 004th run-in block detected", /* C1 00 */
- "302 003rd run-in block detected", /* C2 00 */
- "303 002nd run-in block detected", /* C3 00 */
- "304 001st run-in block detected", /* C4 00 */
- "305 00link block detected", /* C5 00 */
- "306 001st run-out block detected", /* C6 00 */
- "307 002nd run-out block detected", /* C7 00 */
- "314 00write request means mixed data mode", /* CC 00 */
- "315 00unable to ensure reliable writing with the inserted disk - unsupported disk", /* CD 00 */
- "316 00unable to ensure reliable writing as the inserted disk does not support speed",/* CE 00 */
- "317 00unable to ensure reliable writing as the inserted disk has no char id code", /* CF 00 */
- NULL
- };
- LOCAL int
- teac_attach(scgp, dp)
- SCSI *scgp;
- cdr_t *dp;
- {
- scsi_setnonstderrs(scgp, sd_teac50_error_str);
- #ifdef XXDEBUG
- xxtest_teac(scgp);
- exit(0);
- #endif
- return (0);
- }
- LOCAL int
- teac_fixation(scgp, onp, dummy, toctype, tracks, trackp)
- SCSI *scgp;
- int onp;
- int dummy;
- int toctype;
- int tracks;
- track_t *trackp;
- {
- long lba;
- int status;
- u_char *sp;
- int i;
- extern char *buf;
- if (tracks < 1) {
- /*
- * We come here if cdrecord isonly called with the -fix option.
- * As long as we cannot read and interpret the PMA, we must
- * abort here.
- */
- teac_rd_pma(scgp);
- /* errmsgno(EX_BAD, "Cannot fixate zero track disk.n");;*/
- errmsgno(EX_BAD, "Cannot fixate without track list (not yet implemented).n");;
- return (-1);
- }
- sp = (u_char *)buf;
- sleep(1);
- status = clear_subcode(scgp);
- sleep(1);
- if (status < 0)
- return (status);
- sp[0] = 0; /* reserved */
- sp[1] = 0; /* reserved */
- sp[2] = 0; /* Q TNO */
- sp = &sp[3]; /* point past header */
- /*
- * Set up TOC entries for all tracks
- */
- for(i=1; i <= tracks; i++) {
- lba = trackp[i].trackstart+150; /* MSF=00:02:00 is LBA=0 */
- sp = set_toc_subcode(sp,
- /* ctrl/adr for this track */
- st2mode[trackp[i].sectype&ST_MASK], ADR_POS,
- trackp[i].trackno, lba);
- }
- /*
- * Set first track on disk
- *
- * XXX We set the track type for the lead-in to the track type
- * XXX of the first track. The TEAC manual states that we should use
- * XXX audio if the disk contains both, audio and data tracks.
- */
- sp = set_lin_subcode(sp,
- /* ctrl/adr for first track */
- st2mode[trackp[1].sectype&ST_MASK], ADR_POS,
- 0xA0, /* Point A0 */
- trackp[1].trackno, /* first track # */
- toc2sess[toctype & TOC_MASK], /* disk type */
- 0); /* reserved */
- /*
- * Set last track on disk
- */
- sp = set_lin_subcode(sp,
- /* ctrl/adr for first track */
- st2mode[trackp[1].sectype&ST_MASK], ADR_POS,
- 0xA1, /* Point A1 */
- MSF_CONV(trackp[tracks].trackno),/* last track # */
- 0, /* reserved */
- 0); /* reserved */
- /*
- * Set start of lead out area in MSF
- * MSF=00:02:00 is LBA=0
- */
- lba = lba_addr + 150;
- if (lverbose > 1)
- printf("lba: %ld lba_addr: %ldn", lba, lba_addr);
- if (lverbose > 1)
- printf("Lead out start: (%02d:%02d/%02d)n",
- minutes(lba*2352),
- seconds(lba*2352),
- frames(lba*2352));
- sp = set_lin_subcode(sp,
- /* ctrl/adr for first track */
- st2mode[trackp[1].sectype&ST_MASK], ADR_POS,
- 0xA2, /* Point A2 */
- MSF_CONV(LBA_MIN(lba)),
- MSF_CONV(LBA_SEC(lba)),
- MSF_CONV(LBA_FRM(lba)));
- status = sp - ((u_char *)buf);
- if (lverbose > 1) {
- printf("Subcode len: %dn", status);
- scsiprbytes("Subcode:", (u_char *)buf, status);
- }
- status = set_subcode(scgp, (u_char *)buf, status);
- sleep(1);
- if (status < 0)
- return (status);
- /*
- * now write the toc
- */
- status = teac_freeze(scgp, !onp);
- return (status);
- }
- LOCAL int
- teac_open_session(scgp, tracks, trackp, toctype, multi)
- SCSI *scgp;
- int tracks;
- track_t *trackp;
- int toctype;
- int multi;
- {
- int i;
- for (i = 1; i <= tracks; i++) {
- if (trackp[i].tracksize < 0) {
- /*
- * XXX How about setting the subcode range to infinity.
- * XXX and correct it in clode track before writing
- * XXX the PMA?
- */
- errmsgno(EX_BAD, "Track %d has unknown length.n", i);
- return (-1);
- }
- }
- return (teac_calibrate(scgp, toctype, multi));
- }
- LOCAL int
- teac_calibrate(scgp, toctype, multi)
- SCSI *scgp;
- int toctype;
- int multi;
- {
- int status;
- scgp->silent++;
- if (read_B0(scgp, TRUE, &lba_addr, NULL) < 0)
- lba_addr = -150;
- scgp->silent--;
- status = clear_subcode(scgp);
- if (status < 0)
- return (status);
- if (lverbose) {
- fprintf(stdout, "Judging disk...");
- flush();
- }
- status = opt_power_judge(scgp, 1);
- if (status < 0) {
- printf("n");
- return (status);
- }
- if (lverbose) {
- fprintf(stdout, "done.nCalibrating laser...");
- flush();
- }
- status = opt_power_judge(scgp, 0);
- if (lverbose) {
- fprintf(stdout, "done.n");
- }
- scgp->silent++;
- if (next_wr_addr_teac(scgp, -1, -1) < 0) {
- if (scgp->verbose == 0 && scsi_sense_key(scgp) != SC_ILLEGAL_REQUEST)
- scsiprinterr(scgp);
- }
- scgp->silent--;
- return (status);
- }
- /*--------------------------------------------------------------------------*/
- #define SC_SET_LIMITS 0xb3 /* teac 12 byte command */
- #define SC_SET_SUBCODE 0xc2 /* teac 10 byte command */
- #define SC_READ_PMA 0xc4 /* teac 10 byte command */
- #define SC_READ_DISK_INFO 0xc7 /* teac 10 byte command */
- #define SC_BUFFER_INQUIRY 0xe0 /* teac 12 byte command */
- #define SC_WRITE_PMA 0xe1 /* teac 12 byte command */
- #define SC_FREEZE 0xe3 /* teac 12 byte command */
- #define SC_OPC_EXECUTE 0xec /* teac 12 byte command */
- #define SC_CLEAR_SUBCODE 0xe4 /* teac 12 byte command */
- #define SC_NEXT_WR_ADDRESS 0xe6 /* teac 12 byte command */
- #define SC_READ_PEAK_BUF_CAP 0xef /* teac 12 byte command */
- /* -----------------------------------------------------------------
- * Optimum power calibration for Teac Drives.
- ----------------------------------------------------------------- */
- LOCAL int
- opt_power_judge(scgp, judge)
- SCSI *scgp;
- int judge;
- {
- register struct scg_cmd *scmd = scgp->scmd;
- fillbytes((caddr_t)scmd, sizeof(*scmd), ' ');
- scmd->addr = (caddr_t)0;
- scmd->size = 0;
- scmd->flags = SCG_RECV_DATA|SCG_DISRE_ENA;
- scmd->cdb_len = SC_G5_CDBLEN;
- scmd->sense_len = CCS_SENSE_LEN;
- scmd->target = scgp->target;
- scmd->timeout = 60;
- scmd->cdb.g5_cdb.cmd = SC_OPC_EXECUTE;
- scmd->cdb.g5_cdb.lun = scgp->lun;
- scmd->cdb.g5_cdb.reladr = judge; /* Judge the Disc */
- scgp->cmdname = "opt_power_judge";
- return (scsicmd(scgp));
- }
- /* -----------------------------------------------------------------
- * Clear subcodes for Teac Drives.
- ----------------------------------------------------------------- */
- LOCAL int
- clear_subcode(scgp)
- SCSI *scgp;
- {
- register struct scg_cmd *scmd = scgp->scmd;
- fillbytes((caddr_t)scmd, sizeof(*scmd), ' ');
- scmd->addr = (caddr_t)0;
- scmd->size = 0;
- scmd->flags = SCG_DISRE_ENA;
- scmd->cdb_len = SC_G5_CDBLEN;
- scmd->sense_len = CCS_SENSE_LEN;
- scmd->target = scgp->target;
- scmd->cdb.g5_cdb.cmd = SC_CLEAR_SUBCODE;
- scmd->cdb.g5_cdb.lun = scgp->lun;
- scmd->cdb.g5_cdb.addr[3] = 0x80;
- scgp->cmdname = "clear subcode";
- return (scsicmd(scgp));
- }
- /* -----------------------------------------------------------------
- * Set limits for command linking for Teac Drives.
- ----------------------------------------------------------------- */
- LOCAL int
- set_limits(scgp, lba, length)
- SCSI *scgp;
- long lba;
- long length;
- {
- register struct scg_cmd *scmd = scgp->scmd;
- fillbytes((caddr_t)scmd, sizeof(*scmd), ' ');
- scmd->addr = (caddr_t)0;
- scmd->size = 0;
- scmd->flags = SCG_DISRE_ENA;
- scmd->cdb_len = SC_G5_CDBLEN;
- scmd->sense_len = CCS_SENSE_LEN;
- scmd->target = scgp->target;
- scmd->cdb.g5_cdb.cmd = SC_SET_LIMITS;
- scmd->cdb.g5_cdb.lun = scgp->lun;
- i_to_4_byte(&scmd->cdb.g5_cdb.addr[0], lba);
- i_to_4_byte(&scmd->cdb.g5_cdb.count[0], length);
- scgp->cmdname = "set limits";
- return (scsicmd(scgp));
- }
- /* -----------------------------------------------------------------
- * Set subcode for Teac Drives.
- ----------------------------------------------------------------- */
- LOCAL int
- set_subcode(scgp, subcode_data, length)
- SCSI *scgp;
- u_char *subcode_data;
- int length;
- {
- register struct scg_cmd *scmd = scgp->scmd;
- fillbytes((caddr_t)scmd, sizeof(*scmd), ' ');
- scmd->addr = (caddr_t)subcode_data;
- scmd->size = length;
- scmd->flags = SCG_DISRE_ENA;
- scmd->cdb_len = SC_G1_CDBLEN;
- scmd->sense_len = CCS_SENSE_LEN;
- scmd->target = scgp->target;
- scmd->cdb.g1_cdb.cmd = SC_SET_SUBCODE;
- scmd->cdb.g1_cdb.lun = scgp->lun;
- g1_cdblen(&scmd->cdb.g1_cdb, length);
- scgp->cmdname = "set subcode";
- return (scsicmd(scgp));
- }
- LOCAL int
- read_disk_info_teac(scgp, data, length, type)
- SCSI *scgp;
- u_char *data;
- int length;
- int type;
- {
- register struct scg_cmd *scmd = scgp->scmd;
- fillbytes((caddr_t)scmd, sizeof(*scmd), ' ');
- scmd->addr = (caddr_t)data;
- scmd->size = length;
- scmd->flags = SCG_RECV_DATA |SCG_DISRE_ENA;
- scmd->cdb_len = SC_G1_CDBLEN;
- scmd->sense_len = CCS_SENSE_LEN;
- scmd->target = scgp->target;
- scmd->cdb.g1_cdb.cmd = SC_READ_DISK_INFO;
- scmd->cdb.g1_cdb.lun = scgp->lun;
- scmd->cdb.g1_cdb.reladr = type & 1;
- scmd->cdb.g1_cdb.res = (type & 2) >> 1;
- scgp->cmdname = "read disk info teac";
- return (scsicmd(scgp));
- }
- /* -----------------------------------------------------------------
- * Perform the freeze command for Teac Drives.
- ----------------------------------------------------------------- */
- LOCAL int
- teac_freeze(scgp, bp_flag)
- SCSI *scgp;
- int bp_flag;
- {
- register struct scg_cmd *scmd = scgp->scmd;
- fillbytes((caddr_t)scmd, sizeof(*scmd), ' ');
- scmd->addr = (caddr_t)0;
- scmd->size = 0;
- scmd->flags = SCG_DISRE_ENA;
- scmd->cdb_len = SC_G5_CDBLEN;
- scmd->sense_len = CCS_SENSE_LEN;
- scmd->target = scgp->target;
- scmd->timeout = 8 * 60; /* Needs up to 4 minutes */
- scmd->cdb.g5_cdb.cmd = SC_FREEZE;
- scmd->cdb.g5_cdb.lun = scgp->lun;
- scmd->cdb.g5_cdb.addr[3] = bp_flag ? 0x80 : 0;
- scgp->cmdname = "teac_freeze";
- return (scsicmd(scgp));
- }
- LOCAL int
- teac_wr_pma(scgp)
- SCSI *scgp;
- {
- register struct scg_cmd *scmd = scgp->scmd;
- fillbytes((caddr_t)scmd, sizeof(*scmd), ' ');
- scmd->addr = (caddr_t)0;
- scmd->size = 0;
- scmd->flags = SCG_DISRE_ENA;
- scmd->cdb_len = SC_G5_CDBLEN;
- scmd->sense_len = CCS_SENSE_LEN;
- scmd->target = scgp->target;
- scmd->cdb.g5_cdb.cmd = SC_WRITE_PMA;
- scmd->cdb.g5_cdb.lun = scgp->lun;
- scgp->cmdname = "teac_write_pma";
- return (scsicmd(scgp));
- }
- /* -----------------------------------------------------------------
- * Read PMA for Teac Drives.
- ----------------------------------------------------------------- */
- LOCAL int
- teac_rd_pma(scgp)
- SCSI *scgp;
- {
- unsigned char xx[256];
- register struct scg_cmd *scmd = scgp->scmd;
- fillbytes((caddr_t)xx, sizeof(xx), ' ');
- fillbytes((caddr_t)scmd, sizeof(*scmd), ' ');
- scmd->addr = (caddr_t)xx;
- scmd->size = sizeof(xx);
- scmd->flags = SCG_RECV_DATA |SCG_DISRE_ENA;
- scmd->cdb_len = SC_G1_CDBLEN;
- scmd->sense_len = CCS_SENSE_LEN;
- scmd->target = scgp->target;
- scmd->cdb.g1_cdb.cmd = SC_READ_PMA;
- scmd->cdb.g1_cdb.lun = scgp->lun;
- g1_cdblen(&scmd->cdb.g1_cdb, sizeof(xx));
- scgp->cmdname = "teac_read_pma";
- /* return (scsicmd(scgp));*/
- if (scsicmd(scgp) < 0)
- return (-1);
- if (scgp->verbose) {
- scsiprbytes("PMA Data", xx, sizeof(xx) - scsigetresid(scgp));
- }
- if (lverbose) {
- unsigned i;
- Uchar *p;
- scsiprbytes("PMA Header: ", xx, 4);
- i = xx[2];
- p = &xx[4];
- for (; i <= xx[3]; i++) {
- scsiprbytes("PMA: ", p, 10);
- p += 10;
- }
- }
- return (0);
- }
- /* -----------------------------------------------------------------
- * Next writable address for Teac Drives.
- ----------------------------------------------------------------- */
- LOCAL int
- next_wr_addr_teac(scgp, start_lba, last_lba)
- SCSI *scgp;
- long start_lba;
- long last_lba;
- {
- unsigned char xx[256];
- register struct scg_cmd *scmd = scgp->scmd;
- fillbytes((caddr_t)xx, sizeof(xx), ' ');
- fillbytes((caddr_t)scmd, sizeof(*scmd), ' ');
- scmd->addr = (caddr_t)xx;
- scmd->size = sizeof(xx);
- scmd->flags = SCG_RECV_DATA |SCG_DISRE_ENA;
- scmd->cdb_len = SC_G5_CDBLEN;
- scmd->sense_len = CCS_SENSE_LEN;
- scmd->target = scgp->target;
- scmd->cdb.g5_cdb.cmd = SC_NEXT_WR_ADDRESS;
- scmd->cdb.g5_cdb.lun = scgp->lun;
- i_to_4_byte(&scmd->cdb.g5_cdb.addr[0], start_lba);
- i_to_4_byte(&scmd->cdb.g5_cdb.count[0], last_lba);
- if (scgp->verbose)
- printf("start lba: %ld last lba: %ldn",
- start_lba, last_lba);
- scgp->cmdname = "next writable address";
- /* return (scsicmd(scgp));*/
- if (scsicmd(scgp) < 0)
- return (-1);
- if (scgp->verbose) {
- scsiprbytes("WRa Data", xx, sizeof(xx) - scsigetresid(scgp));
- printf("NWA: %ldn", a_to_4_byte(xx));
- }
- return (0);
- }
- LOCAL int
- blank_jvc(scgp, addr, blanktype)
- SCSI *scgp;
- long addr;
- int blanktype;
- {
- extern char *blank_types[];
- if (lverbose) {
- printf("Blanking %sn", blank_types[blanktype & 0x07]);
- flush();
- }
- return (scsi_blank(scgp, addr, blanktype));
- }
- LOCAL int
- buf_cap_teac(scgp, sp, fp)
- SCSI *scgp;
- long *sp; /* Size pointer */
- long *fp; /* Free pointer */
- {
- Ulong freespace;
- Ulong bufsize;
- long ret;
- int per;
- ret = read_peak_buffer_cap_teac(scgp);
- if (ret < 0)
- return (-1);
- bufsize = ret;
- freespace = 0;
- if (sp)
- *sp = bufsize;
- if (fp)
- *fp = freespace;
-
- if (scgp->verbose || (sp == 0 && fp == 0))
- printf("BFree: %ld K BSize: %ld Kn", freespace >> 10, bufsize >> 10);
- if (bufsize == 0)
- return (0);
- per = (100 * (bufsize - freespace)) / bufsize;
- if (per < 0)
- return (0);
- if (per > 100)
- return (100);
- return (per);
- }
- LOCAL long
- read_peak_buffer_cap_teac(scgp)
- SCSI *scgp;
- {
- Uchar xx[4];
- register struct scg_cmd *scmd = scgp->scmd;
- fillbytes((caddr_t)xx, sizeof(xx), ' ');
- fillbytes((caddr_t)scmd, sizeof(*scmd), ' ');
- scmd->addr = (caddr_t)xx;
- scmd->size = sizeof(xx);
- scmd->flags = SCG_RECV_DATA |SCG_DISRE_ENA;
- scmd->cdb_len = SC_G5_CDBLEN;
- scmd->sense_len = CCS_SENSE_LEN;
- scmd->target = scgp->target;
- scmd->cdb.g5_cdb.cmd = SC_READ_PEAK_BUF_CAP;
- scmd->cdb.g5_cdb.lun = scgp->lun;
- scgp->cmdname = "read peak buffer capacity";
- #define BDEBUG
- #ifndef BDEBUG
- return (scsicmd(scgp));
- #else
- if (scsicmd(scgp) < 0)
- return (-1);
- /* if (scgp->verbose) {*/
- scsiprbytes("WRa Data", xx, sizeof(xx) - scsigetresid(scgp));
- printf("Buffer cap: %ldn", a_to_u_3_byte(&xx[1]));
- /* }*/
- return (a_to_u_3_byte(&xx[1]));
- /* return (0);*/
- #endif
- }
- #define BI_ONE_BYTE 0xC0
- #define BI_448_BYTE 0x40
- #define BI_APP_CODE 0x10
- LOCAL int
- buffer_inquiry_teac(scgp, fmt)
- SCSI *scgp;
- int fmt;
- {
- Uchar xx[448];
- register struct scg_cmd *scmd = scgp->scmd;
- fillbytes((caddr_t)xx, sizeof(xx), ' ');
- fillbytes((caddr_t)scmd, sizeof(*scmd), ' ');
- scmd->addr = (caddr_t)xx;
- scmd->size = sizeof(xx);
- scmd->size = 448;
- scmd->flags = SCG_RECV_DATA |SCG_DISRE_ENA;
- scmd->cdb_len = SC_G5_CDBLEN;
- scmd->sense_len = CCS_SENSE_LEN;
- scmd->target = scgp->target;
- scmd->cdb.g5_cdb.cmd = SC_BUFFER_INQUIRY;
- scmd->cdb.g5_cdb.lun = scgp->lun;
- if (fmt > 0) {
- scmd->cdb.g5_cdb.addr[3] = fmt;
- if (fmt == BI_ONE_BYTE)
- scmd->size = 1;
- } else {
- scmd->cdb.g5_cdb.addr[3] = BI_448_BYTE;
- /* scmd->cdb.g5_cdb.addr[3] = BI_APP_CODE;*/
- }
- scgp->cmdname = "buffer inquiry";
- #define BDEBUG
- #ifndef BDEBUG
- return (scsicmd(scgp));
- #else
- if (scsicmd(scgp) < 0)
- return (-1);
- /* if (scgp->verbose) {*/
- /* scsiprbytes("WRa Data", xx, sizeof(xx) - scsigetresid(scgp));*/
- /* scsiprbytes("WRa Data", xx, 1);*/
- if (fmt > 0) printf("fmt: %X ", fmt);
- scsiprbytes("WRa Data", xx, 9);
- printf("%dn", xx[8] - xx[1]);
- /* printf("Buffer cap: %ldn", a_to_u_3_byte(&xx[1]));*/
- /* }*/
- return (0);
- #endif
- }
- #ifdef XXBUFFER
- LOCAL void
- check_buffer_teac(scgp)
- SCSI *scgp;
- {
- printf("-------n");
- buffer_inquiry_teac(scgp, 0);
- #ifdef SL
- usleep(40000);
- buffer_inquiry_teac(scgp, 0);
- #endif
- read_peak_buffer_cap_teac(scgp);
- }
- #endif
- /*--------------------------------------------------------------------------*/
- #ifdef XXDEBUG
- #include "scsimmc.h"
- LOCAL int g7_teac __PR((SCSI *scgp));
- LOCAL int g6_teac __PR((SCSI *scgp));
- LOCAL int
- g7_teac(scgp)
- SCSI *scgp;
- {
- Uchar xx[2048];
- register struct scg_cmd *scmd = scgp->scmd;
- fillbytes((caddr_t)xx, sizeof(xx), ' ');
- fillbytes((caddr_t)scmd, sizeof(*scmd), ' ');
- scmd->addr = (caddr_t)xx;
- scmd->size = sizeof(xx);
- scmd->flags = SCG_RECV_DATA |SCG_DISRE_ENA;
- scmd->cdb_len = SC_G5_CDBLEN;
- scmd->sense_len = CCS_SENSE_LEN;
- scmd->target = scgp->target;
- scmd->cdb.g5_cdb.cmd = 0xDf;
- /* scmd->cdb.g5_cdb.cmd = 0xE5;*/
- scmd->cdb.g5_cdb.lun = scgp->lun;
- /* scmd->cdb.g5_cdb.addr[3] = BI_ONE_BYTE;*/
- /* scmd->size = 1;*/
- /* scmd->cdb.g5_cdb.addr[3] = BI_448_BYTE;*/
- /* scmd->cdb.g5_cdb.addr[3] = BI_APP_CODE;*/
- scgp->cmdname = "g7 teac";
- /* return (scsicmd(scgp));*/
- if (scsicmd(scgp) < 0)
- return (-1);
- /* if (scgp->verbose) {*/
- scsiprbytes("WRa Data", xx, sizeof(xx) - scsigetresid(scgp));
- /* scsiprbytes("WRa Data", xx, 1);*/
- /* scsiprbytes("WRa Data", xx, 9);*/
- /*printf("%dn", xx[8] - xx[1]);*/
- /* printf("Buffer cap: %ldn", a_to_u_3_byte(&xx[1]));*/
- /* }*/
- return (0);
- }
- LOCAL int
- g6_teac(scgp)
- SCSI *scgp;
- {
- Uchar xx[2048];
- register struct scg_cmd *scmd = scgp->scmd;
- fillbytes((caddr_t)xx, sizeof(xx), ' ');
- fillbytes((caddr_t)scmd, sizeof(*scmd), ' ');
- scmd->addr = (caddr_t)xx;
- scmd->size = sizeof(xx);
- scmd->flags = SCG_RECV_DATA |SCG_DISRE_ENA;
- scmd->cdb_len = SC_G1_CDBLEN;
- scmd->sense_len = CCS_SENSE_LEN;
- scmd->target = scgp->target;
- scmd->cdb.g1_cdb.cmd = 0xC1;
- scmd->cdb.g1_cdb.cmd = 0xC3;
- scmd->cdb.g1_cdb.cmd = 0xC6;
- scmd->cdb.g1_cdb.cmd = 0xC7; /* Read TOC */
- scmd->cdb.g1_cdb.cmd = 0xCe;
- scmd->cdb.g1_cdb.cmd = 0xCF;
- scmd->cdb.g1_cdb.cmd = 0xC7; /* Read TOC */
- scmd->cdb.g1_cdb.lun = scgp->lun;
- scgp->cmdname = "g6 teac";
- /* return (scsicmd(scgp));*/
- if (scsicmd(scgp) < 0)
- return (-1);
- /* if (scgp->verbose) {*/
- scsiprbytes("WRa Data", xx, sizeof(xx) - scsigetresid(scgp));
- /* scsiprbytes("WRa Data", xx, 1);*/
- /* scsiprbytes("WRa Data", xx, 9);*/
- /*printf("%dn", xx[8] - xx[1]);*/
- /* printf("Buffer cap: %ldn", a_to_u_3_byte(&xx[1]));*/
- /* }*/
- return (0);
- }
- LOCAL void
- xxtest_teac(scgp)
- SCSI *scgp;
- {
- read_peak_buffer_cap_teac(scgp);
- /*#define XDI*/
- #ifdef XDI
- {
- u_char cbuf[512];
- /* read_disk_info_teac(scgp, data, length, type)*/
- /* read_disk_info_teac(scgp, cbuf, 512, 2);*/
- /* read_disk_info_teac(scgp, cbuf, 512, 2);*/
- read_disk_info_teac(scgp, cbuf, 512, 3);
- scsiprbytes("DI Data", cbuf, sizeof(cbuf) - scsigetresid(scgp));
- }
- #endif /* XDI */
- buffer_inquiry_teac(scgp, -1);
- /*#define XBU*/
- #ifdef XBU
- {
- int i;
- for (i = 0; i < 63; i++) {
- scgp->silent++;
- buffer_inquiry_teac(scgp, i<<2);
- scgp->silent--;
- }
- }
- #endif /* XBU */
- /* printf("LLLLn");*/
- /* g7_teac(scgp);*/
- /* g6_teac(scgp);*/
- }
- #endif /* XXDEBUG */