| 106 |
#endif |
#endif |
| 107 |
#include <vadefs.h> |
#include <vadefs.h> |
| 108 |
|
|
| 109 |
#include <scg/scsitransp.h> |
#include <usal/scsitransp.h> |
| 110 |
|
|
| 111 |
#ifdef HAVE_AREAS |
#ifdef HAVE_AREAS |
| 112 |
#include <be/kernel/OS.h> |
#include <be/kernel/OS.h> |
| 632 |
|
|
| 633 |
#include "scsi_cmds.h" |
#include "scsi_cmds.h" |
| 634 |
|
|
| 635 |
static int RealEnd(SCSI *scgp, UINT4 *buff); |
static int RealEnd(SCSI *usalp, UINT4 *buff); |
| 636 |
|
|
| 637 |
static int RealEnd(SCSI *scgp, UINT4 *buff) |
static int RealEnd(SCSI *usalp, UINT4 *buff) |
| 638 |
{ |
{ |
| 639 |
if (scg_cmd_err(scgp) != 0) { |
if (usal_cmd_err(usalp) != 0) { |
| 640 |
int c,k,q; |
int c,k,q; |
| 641 |
|
|
| 642 |
k = scg_sense_key(scgp); |
k = usal_sense_key(usalp); |
| 643 |
c = scg_sense_code(scgp); |
c = usal_sense_code(usalp); |
| 644 |
q = scg_sense_qual(scgp); |
q = usal_sense_qual(usalp); |
| 645 |
if ((k == 0x05 /* ILLEGAL_REQUEST */ && |
if ((k == 0x05 /* ILLEGAL_REQUEST */ && |
| 646 |
c == 0x21 /* lba out of range */ && |
c == 0x21 /* lba out of range */ && |
| 647 |
q == 0x00) || |
q == 0x00) || |
| 655 |
} |
} |
| 656 |
} |
} |
| 657 |
|
|
| 658 |
if (scg_getresid(scgp) > 16) return 1; |
if (usal_getresid(usalp) > 16) return 1; |
| 659 |
|
|
| 660 |
{ |
{ |
| 661 |
unsigned char *p; |
unsigned char *p; |
| 1056 |
#endif |
#endif |
| 1057 |
|
|
| 1058 |
if (child_pid != 0) { |
if (child_pid != 0) { |
| 1059 |
SCSI *scgp = get_scsi_p(); |
SCSI *usalp = get_scsi_p(); |
| 1060 |
if (scgp->running) { |
if (usalp->running) { |
| 1061 |
scgp->cb_fun = on_exitscsi; |
usalp->cb_fun = on_exitscsi; |
| 1062 |
scgp->cb_arg = (void *)status; |
usalp->cb_arg = (void *)status; |
| 1063 |
} else { |
} else { |
| 1064 |
on_exitscsi((void *)status); |
on_exitscsi((void *)status); |
| 1065 |
} |
} |
| 1365 |
|
|
| 1366 |
retry_count = 0; |
retry_count = 0; |
| 1367 |
do { |
do { |
| 1368 |
SCSI *scgp = get_scsi_p(); |
SCSI *usalp = get_scsi_p(); |
| 1369 |
int retval; |
int retval; |
| 1370 |
#ifdef DEBUG_READS |
#ifdef DEBUG_READS |
| 1371 |
fprintf(stderr, "reading from %lu to %lu, overlap %u\n", lSector, lSector + SectorBurst -1, global.overlap); |
fprintf(stderr, "reading from %lu to %lu, overlap %u\n", lSector, lSector + SectorBurst -1, global.overlap); |
| 1384 |
|
|
| 1385 |
/* we switch to single sector reads, |
/* we switch to single sector reads, |
| 1386 |
* in order to handle the remaining sectors. */ |
* in order to handle the remaining sectors. */ |
| 1387 |
scgp->silent++; |
usalp->silent++; |
| 1388 |
do { |
do { |
| 1389 |
int retval2 = ReadCdRomSub( scgp, bufferSub, lSector+singles, 1 ); |
int retval2 = ReadCdRomSub( usalp, bufferSub, lSector+singles, 1 ); |
| 1390 |
*eorecording = RealEnd( scgp, bufferSub ); |
*eorecording = RealEnd( usalp, bufferSub ); |
| 1391 |
if (*eorecording) { |
if (*eorecording) { |
| 1392 |
break; |
break; |
| 1393 |
} |
} |
| 1394 |
memcpy(p->data+singles*CD_FRAMESAMPLES, bufferSub, CD_FRAMESIZE_RAW); |
memcpy(p->data+singles*CD_FRAMESAMPLES, bufferSub, CD_FRAMESIZE_RAW); |
| 1395 |
singles++; |
singles++; |
| 1396 |
} while (singles < SectorBurst); |
} while (singles < SectorBurst); |
| 1397 |
scgp->silent--; |
usalp->silent--; |
| 1398 |
|
|
| 1399 |
if ( *eorecording ) { |
if ( *eorecording ) { |
| 1400 |
patch_real_end(lSector+singles); |
patch_real_end(lSector+singles); |
| 1413 |
|
|
| 1414 |
} |
} |
| 1415 |
} else { |
} else { |
| 1416 |
retval = ReadCdRom( scgp, p->data, lSector, SectorBurst ); |
retval = ReadCdRom( usalp, p->data, lSector, SectorBurst ); |
| 1417 |
} |
} |
| 1418 |
handle_inputendianess(p->data, SectorBurst * CD_FRAMESAMPLES); |
handle_inputendianess(p->data, SectorBurst * CD_FRAMESAMPLES); |
| 1419 |
if (NULL == |
if (NULL == |