Subject: Re: Yes, but is anyone using cdrdao?? (was: Re: anyone using cdreco
To: None <port-alpha@netbsd.org>
From: Juergen Weiss <weiss@Uni-Mainz.DE>
List: port-alpha
Date: 01/12/2001 20:23:16
Here are the diffs for cdrdao-1.1.3.
diff -rc cdrdao-1.1.3/dao/CdrDriver.cc cdrdao-1.1.3.mod/dao/CdrDriver.cc
*** cdrdao-1.1.3/dao/CdrDriver.cc Tue Oct 26 18:13:45 1999
--- cdrdao-1.1.3.mod/dao/CdrDriver.cc Tue Mar 14 22:24:18 2000
***************
*** 119,124 ****
--- 119,126 ----
{ "generic-mmc", "MATSHITA", "CD-ROM CR-588", 0 },
{ "generic-mmc", "MEMOREX", "CD-233E", 0 },
{ "generic-mmc", "PIONEER", "DVD-103", OPT_MMC_USE_PQ|OPT_MMC_PQ_BCD },
+ { "generic-mmc", "PHILIPS", "CDD3600", OPT_MMC_NO_SUBCHAN },
+ { "generic-mmc", "PHILIPS", "CDD3610", OPT_MMC_NO_SUBCHAN },
{ "generic-mmc", "SONY", "CD-ROM CDU31A-02", 0 },
{ "generic-mmc", "TEAC", "CD-532E", OPT_MMC_USE_PQ|OPT_MMC_PQ_BCD },
{ "generic-mmc", "TOSHIBA", "CD-ROM XM-6302B", 0 },
diff -rc cdrdao-1.1.3/dao/GenericMMC.cc cdrdao-1.1.3.mod/dao/GenericMMC.cc
*** cdrdao-1.1.3/dao/GenericMMC.cc Tue Oct 26 18:13:45 1999
--- cdrdao-1.1.3.mod/dao/GenericMMC.cc Sun Mar 12 22:41:09 2000
***************
*** 1488,1493 ****
--- 1488,1494 ----
// read disk toc length
memset(cmd, 0, 10);
cmd[0] = 0x43; // READ TOC
+ cmd[1] = 2;
cmd[2] = 2;
cmd[6] = sessionNr;
cmd[8] = 4;
diff -rc cdrdao-1.1.3/dao/PWSubChannel96.h cdrdao-1.1.3.mod/dao/PWSubChannel96.h
*** cdrdao-1.1.3/dao/PWSubChannel96.h Tue Oct 26 18:13:45 1999
--- cdrdao-1.1.3.mod/dao/PWSubChannel96.h Sun Mar 5 18:50:10 2000
***************
*** 48,54 ****
PWSubChannel96();
PWSubChannel96(unsigned char *buf);
! ~PWSubChannel96();
// virtual constructors:
// create sub channel with specified q-mode
--- 48,54 ----
PWSubChannel96();
PWSubChannel96(unsigned char *buf);
! virtual ~PWSubChannel96();
// virtual constructors:
// create sub channel with specified q-mode
diff -rc cdrdao-1.1.3/edc_ecc/crcmodel.c cdrdao-1.1.3.mod/edc_ecc/crcmodel.c
*** cdrdao-1.1.3/edc_ecc/crcmodel.c Tue Oct 26 18:13:45 1999
--- cdrdao-1.1.3.mod/edc_ecc/crcmodel.c Sun Mar 12 20:09:04 2000
***************
*** 38,54 ****
/****************************************************************************/
! LOCAL ulong reflect P_((ulong v,int b));
! LOCAL ulong reflect (v,b)
/* Returns the value v with the bottom b [0,32] bits reflected. */
/* Example: reflect(0x3e23L,3) == 0x3e26 */
! ulong v;
int b;
{
int i;
! ulong t = v;
for (i=0; i<b; i++)
{
if (t & 1L)
--- 38,54 ----
/****************************************************************************/
! LOCAL u_int32_t reflect P_((u_int32_t v,int b));
! LOCAL u_int32_t reflect (v,b)
/* Returns the value v with the bottom b [0,32] bits reflected. */
/* Example: reflect(0x3e23L,3) == 0x3e26 */
! u_int32_t v;
int b;
{
int i;
! u_int32_t t = v;
for (i=0; i<b; i++)
{
if (t & 1L)
***************
*** 64,71 ****
/****************************************************************************/
! LOCAL ulong widmask P_((p_cm_t));
! LOCAL ulong widmask (p_cm)
/* Returns a longword whose value is (2^p_cm->cm_width)-1. */
/* The trick is to do this portably (e.g. without doing <<32). */
p_cm_t p_cm;
--- 64,71 ----
/****************************************************************************/
! LOCAL u_int32_t widmask P_((p_cm_t));
! LOCAL u_int32_t widmask (p_cm)
/* Returns a longword whose value is (2^p_cm->cm_width)-1. */
/* The trick is to do this portably (e.g. without doing <<32). */
p_cm_t p_cm;
***************
*** 88,95 ****
int ch;
{
int i;
! ulong uch = (ulong) ch;
! ulong topbit = BITMASK(p_cm->cm_width-1);
if (p_cm->cm_refin) uch = reflect(uch,8);
p_cm->cm_reg ^= (uch << (p_cm->cm_width-8));
--- 88,95 ----
int ch;
{
int i;
! u_int32_t uch = (u_int32_t) ch;
! u_int32_t topbit = BITMASK(p_cm->cm_width-1);
if (p_cm->cm_refin) uch = reflect(uch,8);
p_cm->cm_reg ^= (uch << (p_cm->cm_width-8));
***************
*** 115,121 ****
/****************************************************************************/
! ulong cm_crc (p_cm)
p_cm_t p_cm;
{
if (p_cm->cm_refot)
--- 115,121 ----
/****************************************************************************/
! u_int32_t cm_crc (p_cm)
p_cm_t p_cm;
{
if (p_cm->cm_refot)
***************
*** 126,139 ****
/****************************************************************************/
! ulong cm_tab (p_cm,index)
p_cm_t p_cm;
int index;
{
int i;
! ulong r;
! ulong topbit = BITMASK(p_cm->cm_width-1);
! ulong inbyte = (ulong) index;
if (p_cm->cm_refin) inbyte = reflect(inbyte,8);
r = inbyte << (p_cm->cm_width-8);
--- 126,139 ----
/****************************************************************************/
! u_int32_t cm_tab (p_cm,index)
p_cm_t p_cm;
int index;
{
int i;
! u_int32_t r;
! u_int32_t topbit = BITMASK(p_cm->cm_width-1);
! u_int32_t inbyte = (u_int32_t) index;
if (p_cm->cm_refin) inbyte = reflect(inbyte,8);
r = inbyte << (p_cm->cm_width-8);
diff -rc cdrdao-1.1.3/edc_ecc/crcmodel.h cdrdao-1.1.3.mod/edc_ecc/crcmodel.h
*** cdrdao-1.1.3/edc_ecc/crcmodel.h Tue Oct 26 18:13:45 1999
--- cdrdao-1.1.3.mod/edc_ecc/crcmodel.h Sun Mar 12 20:10:41 2000
***************
*** 78,84 ****
#ifndef DONE_STYLE
! typedef unsigned long ulong;
typedef unsigned bool;
typedef unsigned char * p_ubyte_;
--- 78,84 ----
#ifndef DONE_STYLE
! #include <sys/types.h>
typedef unsigned bool;
typedef unsigned char * p_ubyte_;
***************
*** 106,118 ****
typedef struct
{
int cm_width; /* Parameter: Width in bits [8,32]. */
! ulong cm_poly; /* Parameter: The algorithm's polynomial. */
! ulong cm_init; /* Parameter: Initial register value. */
bool cm_refin; /* Parameter: Reflect input bytes? */
bool cm_refot; /* Parameter: Reflect output CRC? */
! ulong cm_xorot; /* Parameter: XOR this to output CRC. */
! ulong cm_reg; /* Context: Context during execution. */
} cm_t;
typedef cm_t *p_cm_t;
--- 106,118 ----
typedef struct
{
int cm_width; /* Parameter: Width in bits [8,32]. */
! u_int32_t cm_poly; /* Parameter: The algorithm's polynomial. */
! u_int32_t cm_init; /* Parameter: Initial register value. */
bool cm_refin; /* Parameter: Reflect input bytes? */
bool cm_refot; /* Parameter: Reflect output CRC? */
! u_int32_t cm_xorot; /* Parameter: XOR this to output CRC. */
! u_int32_t cm_reg; /* Context: Context during execution. */
} cm_t;
typedef cm_t *p_cm_t;
***************
*** 134,140 ****
/* Processes a block of message bytes. */
! ulong cm_crc P_((p_cm_t p_cm));
/* Returns the CRC value for the message bytes processed so far. */
--- 134,140 ----
/* Processes a block of message bytes. */
! u_int32_t cm_crc P_((p_cm_t p_cm));
/* Returns the CRC value for the message bytes processed so far. */
***************
*** 144,150 ****
/* The following function can be used to calculate a CRC lookup table. */
/* It can also be used at run-time to create or check static tables. */
! ulong cm_tab P_((p_cm_t p_cm,int index));
/* Returns the i'th entry for the lookup table for the specified algorithm. */
/* The function examines the fields cm_width, cm_poly, cm_refin, and the */
--- 144,150 ----
/* The following function can be used to calculate a CRC lookup table. */
/* It can also be used at run-time to create or check static tables. */
! u_int32_t cm_tab P_((p_cm_t p_cm,int index));
/* Returns the i'th entry for the lookup table for the specified algorithm. */
/* The function examines the fields cm_width, cm_poly, cm_refin, and the */
diff -rc cdrdao-1.1.3/edc_ecc/crctable.c cdrdao-1.1.3.mod/edc_ecc/crctable.c
*** cdrdao-1.1.3/edc_ecc/crctable.c Tue Oct 26 18:13:45 1999
--- cdrdao-1.1.3.mod/edc_ecc/crctable.c Sun Mar 12 20:18:38 2000
***************
*** 97,109 ****
WR("/* */\n");
WP("/* Width : %1lu bytes. */\n",
! (ulong) TB_WIDTH);
if (TB_WIDTH == 2)
WP("/* Poly : 0x%04lX */\n",
! (ulong) TB_POLY);
else
WP("/* Poly : 0x%08lXL */\n",
! (ulong) TB_POLY);
if (TB_REVER)
WR("/* Reverse : TRUE. */\n");
else
--- 97,109 ----
WR("/* */\n");
WP("/* Width : %1lu bytes. */\n",
! (u_int32_t) TB_WIDTH);
if (TB_WIDTH == 2)
WP("/* Poly : 0x%04lX */\n",
! (u_int32_t) TB_POLY);
else
WP("/* Poly : 0x%08lXL */\n",
! (u_int32_t) TB_POLY);
if (TB_REVER)
WR("/* Reverse : TRUE. */\n");
else
***************
*** 121,127 ****
switch (TB_WIDTH)
{
case 2: WR("unsigned short EDC_crctable[256] =\n{\n"); break;
! case 4: WR("unsigned long EDC_crctable[256] =\n{\n"); break;
default: chk_err("gentable: TB_WIDTH is invalid.");
}
chk_err("");
--- 121,127 ----
switch (TB_WIDTH)
{
case 2: WR("unsigned short EDC_crctable[256] =\n{\n"); break;
! case 4: WR("u_int32_t EDC_crctable[256] =\n{\n"); break;
default: chk_err("gentable: TB_WIDTH is invalid.");
}
chk_err("");
***************
*** 129,135 ****
{
int i;
cm_t cm;
! char *form = (TB_WIDTH==2) ? "0x%04lX" : "0x%08lXL";
int perline = (TB_WIDTH==2) ? 8 : 4;
cm.cm_width = TB_WIDTH*8;
--- 129,135 ----
{
int i;
cm_t cm;
! char *form = (TB_WIDTH==2) ? "0x%04X" : "0x%08XU";
int perline = (TB_WIDTH==2) ? 8 : 4;
cm.cm_width = TB_WIDTH*8;
***************
*** 139,145 ****
for (i=0; i<256; i++)
{
WR(" ");
! WP(form,(ulong) cm_tab(&cm,i));
if (i != 255) WR(",");
if (((i+1) % perline) == 0) WR("\n");
chk_err("");
--- 139,145 ----
for (i=0; i<256; i++)
{
WR(" ");
! WP(form,(u_int32_t) cm_tab(&cm,i));
if (i != 255) WR(",");
if (((i+1) % perline) == 0) WR("\n");
chk_err("");
diff -rc cdrdao-1.1.3/edc_ecc/sniptype.h cdrdao-1.1.3.mod/edc_ecc/sniptype.h
*** cdrdao-1.1.3/edc_ecc/sniptype.h Tue Oct 26 18:13:45 1999
--- cdrdao-1.1.3.mod/edc_ecc/sniptype.h Sun Mar 12 20:07:03 2000
***************
*** 16,22 ****
--- 16,26 ----
&& !defined(_WINDOWS)
#if !defined(OS2)
typedef unsigned char BYTE;
+ #if defined(__alpha__)
+ typedef unsigned int DWORD;
+ #else
typedef unsigned long DWORD;
+ #endif
#endif
typedef unsigned short WORD;
#else
diff -rc cdrdao-1.1.3/scsilib/include/mconfig.h cdrdao-1.1.3.mod/scsilib/include/mconfig.h
*** cdrdao-1.1.3/scsilib/include/mconfig.h Sat Sep 11 21:57:59 1999
--- cdrdao-1.1.3.mod/scsilib/include/mconfig.h Wed Mar 1 21:30:01 2000
***************
*** 45,51 ****
extern "C" {
#endif
! #if defined(unix) || defined(__unix) || defined(__unix__)
# define IS_UNIX
#endif
--- 45,51 ----
extern "C" {
#endif
! #if defined(unix) || defined(__unix) || defined(__unix__) || defined(__NetBSD__)
# define IS_UNIX
#endif
diff -rc cdrdao-1.1.3/scsilib/lib/fillbytes.c cdrdao-1.1.3.mod/scsilib/lib/fillbytes.c
*** cdrdao-1.1.3/scsilib/lib/fillbytes.c Sun Feb 15 20:38:20 1998
--- cdrdao-1.1.3.mod/scsilib/lib/fillbytes.c Sun Mar 12 19:54:54 2000
***************
*** 45,51 ****
lval = val & 0xFF;
! while (!laligned(to)) {
*to++ = cval;
n--;
}
--- 45,51 ----
lval = val & 0xFF;
! while (!laligned(to) && n > 0) {
*to++ = cval;
n--;
}
diff -rc cdrdao-1.1.3/scsilib/libscg/scsi-bsd.c cdrdao-1.1.3.mod/scsilib/libscg/scsi-bsd.c
*** cdrdao-1.1.3/scsilib/libscg/scsi-bsd.c Mon Sep 13 21:41:38 1999
--- cdrdao-1.1.3.mod/scsilib/libscg/scsi-bsd.c Sun Mar 12 19:13:12 2000
***************
*** 361,368 ****
struct scg_cmd *sp;
{
scsireq_t req;
- register long *lp1;
- register long *lp2;
int ret = 0;
/* printf("f: %d\n", f);*/
--- 361,366 ----
***************
*** 377,388 ****
req.flags |= SCCMD_WRITE;
req.timeout = sp->timeout * 1000;
! lp1 = (long *)sp->cdb.cmd_cdb;
! lp2 = (long *)req.cmd;
! *lp2++ = *lp1++;
! *lp2++ = *lp1++;
! *lp2++ = *lp1++;
! *lp2++ = *lp1++;
req.cmdlen = sp->cdb_len;
req.databuf = sp->addr;
req.datalen = sp->size;
--- 375,381 ----
req.flags |= SCCMD_WRITE;
req.timeout = sp->timeout * 1000;
! memcpy(req.cmd, sp->cdb.cmd_cdb, sp->cdb_len);
req.cmdlen = sp->cdb_len;
req.databuf = sp->addr;
req.datalen = sp->size;
--
Juergen Weiss | Universitaet Mainz, Zentrum f"ur Datenverarbeitung,
weiss@uni-mainz.de | 55099 Mainz, Tel: 06131/39-26361, FAX: 06131/39-26407