|
|
3e3291 |
Index: /trunk/cdparanoia/interface/test_interface.c
|
|
|
3e3291 |
===================================================================
|
|
|
3e3291 |
--- /trunk/cdparanoia/interface/test_interface.c (revision 15299)
|
|
|
3e3291 |
+++ /trunk/cdparanoia/interface/test_interface.c (revision 15338)
|
|
|
3e3291 |
@@ -67,7 +67,7 @@
|
|
|
3e3291 |
|
|
|
3e3291 |
if(begin
|
|
|
3e3291 |
- d->private->last_milliseconds=20;
|
|
|
3e3291 |
+ d->private_data->last_milliseconds=20;
|
|
|
3e3291 |
else
|
|
|
3e3291 |
- d->private->last_milliseconds=sectors;
|
|
|
3e3291 |
+ d->private_data->last_milliseconds=sectors;
|
|
|
3e3291 |
|
|
|
3e3291 |
#ifdef CDDA_TEST_UNDERRUN
|
|
|
3e3291 |
Index: /trunk/cdparanoia/interface/cdda_interface.h
|
|
|
3e3291 |
===================================================================
|
|
|
3e3291 |
--- /trunk/cdparanoia/interface/cdda_interface.h (revision 15290)
|
|
|
3e3291 |
+++ /trunk/cdparanoia/interface/cdda_interface.h (revision 15338)
|
|
|
3e3291 |
@@ -85,5 +85,5 @@
|
|
|
3e3291 |
int is_mmc;
|
|
|
3e3291 |
|
|
|
3e3291 |
- cdda_private_data_t *private;
|
|
|
3e3291 |
+ cdda_private_data_t *private_data;
|
|
|
3e3291 |
void *reserved;
|
|
|
3e3291 |
unsigned char inqbytes[4];
|
|
|
3e3291 |
Index: /trunk/cdparanoia/interface/interface.c
|
|
|
3e3291 |
===================================================================
|
|
|
3e3291 |
--- /trunk/cdparanoia/interface/interface.c (revision 15314)
|
|
|
3e3291 |
+++ /trunk/cdparanoia/interface/interface.c (revision 15338)
|
|
|
3e3291 |
@@ -40,7 +40,7 @@
|
|
|
3e3291 |
if(d->cdda_fd!=-1)close(d->cdda_fd);
|
|
|
3e3291 |
if(d->ioctl_fd!=-1 && d->ioctl_fd!=d->cdda_fd)close(d->ioctl_fd);
|
|
|
3e3291 |
- if(d->private){
|
|
|
3e3291 |
- if(d->private->sg_hd)free(d->private->sg_hd);
|
|
|
3e3291 |
- free(d->private);
|
|
|
3e3291 |
+ if(d->private_data){
|
|
|
3e3291 |
+ if(d->private_data->sg_hd)free(d->private_data->sg_hd);
|
|
|
3e3291 |
+ free(d->private_data);
|
|
|
3e3291 |
}
|
|
|
3e3291 |
|
|
|
3e3291 |
@@ -128,5 +128,5 @@
|
|
|
3e3291 |
}
|
|
|
3e3291 |
}
|
|
|
3e3291 |
- if(ms)*ms=d->private->last_milliseconds;
|
|
|
3e3291 |
+ if(ms)*ms=d->private_data->last_milliseconds;
|
|
|
3e3291 |
return(sectors);
|
|
|
3e3291 |
}
|
|
|
3e3291 |
Index: /trunk/cdparanoia/interface/scsi_interface.c
|
|
|
3e3291 |
===================================================================
|
|
|
3e3291 |
--- /trunk/cdparanoia/interface/scsi_interface.c (revision 15314)
|
|
|
3e3291 |
+++ /trunk/cdparanoia/interface/scsi_interface.c (revision 15338)
|
|
|
3e3291 |
@@ -16,11 +16,11 @@
|
|
|
3e3291 |
struct timespec tv1;
|
|
|
3e3291 |
struct timespec tv2;
|
|
|
3e3291 |
- int ret1=clock_gettime(d->private->clock,&tv1);
|
|
|
3e3291 |
+ int ret1=clock_gettime(d->private_data->clock,&tv1);
|
|
|
3e3291 |
int ret2=ioctl(fd, command,arg);
|
|
|
3e3291 |
- int ret3=clock_gettime(d->private->clock,&tv2);
|
|
|
3e3291 |
+ int ret3=clock_gettime(d->private_data->clock,&tv2);
|
|
|
3e3291 |
if(ret1<0 || ret3<0){
|
|
|
3e3291 |
- d->private->last_milliseconds=-1;
|
|
|
3e3291 |
+ d->private_data->last_milliseconds=-1;
|
|
|
3e3291 |
}else{
|
|
|
3e3291 |
- d->private->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000. + (tv2.tv_nsec-tv1.tv_nsec)/1000000.;
|
|
|
3e3291 |
+ d->private_data->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000. + (tv2.tv_nsec-tv1.tv_nsec)/1000000.;
|
|
|
3e3291 |
}
|
|
|
3e3291 |
return ret2;
|
|
|
3e3291 |
@@ -97,5 +97,5 @@
|
|
|
3e3291 |
fd_set fdset;
|
|
|
3e3291 |
struct timeval tv;
|
|
|
3e3291 |
- struct sg_header *sg_hd=d->private->sg_hd;
|
|
|
3e3291 |
+ struct sg_header *sg_hd=d->private_data->sg_hd;
|
|
|
3e3291 |
int flag=0;
|
|
|
3e3291 |
|
|
|
3e3291 |
@@ -186,5 +186,5 @@
|
|
|
3e3291 |
int tret1,tret2;
|
|
|
3e3291 |
int status = 0;
|
|
|
3e3291 |
- struct sg_header *sg_hd=d->private->sg_hd;
|
|
|
3e3291 |
+ struct sg_header *sg_hd=d->private_data->sg_hd;
|
|
|
3e3291 |
long writebytes=SG_OFF+cmd_len+in_size;
|
|
|
3e3291 |
|
|
|
3e3291 |
@@ -196,5 +196,5 @@
|
|
|
3e3291 |
memset(sg_hd,0,sizeof(sg_hd));
|
|
|
3e3291 |
memset(sense_buffer,0,SG_MAX_SENSE);
|
|
|
3e3291 |
- memcpy(d->private->sg_buffer,cmd,cmd_len+in_size);
|
|
|
3e3291 |
+ memcpy(d->private_data->sg_buffer,cmd,cmd_len+in_size);
|
|
|
3e3291 |
sg_hd->twelve_byte = cmd_len == 12;
|
|
|
3e3291 |
sg_hd->result = 0;
|
|
|
3e3291 |
@@ -210,5 +210,5 @@
|
|
|
3e3291 |
|
|
|
3e3291 |
if(bytecheck && out_size>in_size){
|
|
|
3e3291 |
- memset(d->private->sg_buffer+cmd_len+in_size,bytefill,out_size-in_size);
|
|
|
3e3291 |
+ memset(d->private_data->sg_buffer+cmd_len+in_size,bytefill,out_size-in_size);
|
|
|
3e3291 |
/* the size does not remove cmd_len due to the way the kernel
|
|
|
3e3291 |
driver copies buffers */
|
|
|
3e3291 |
@@ -244,5 +244,5 @@
|
|
|
3e3291 |
|
|
|
3e3291 |
sigprocmask (SIG_BLOCK, &(d->sigset), NULL );
|
|
|
3e3291 |
- tret1=clock_gettime(d->private->clock,&tv1);
|
|
|
3e3291 |
+ tret1=clock_gettime(d->private_data->clock,&tv1);
|
|
|
3e3291 |
errno=0;
|
|
|
3e3291 |
status = write(d->cdda_fd, sg_hd, writebytes );
|
|
|
3e3291 |
@@ -290,5 +290,5 @@
|
|
|
3e3291 |
}
|
|
|
3e3291 |
|
|
|
3e3291 |
- tret2=clock_gettime(d->private->clock,&tv2);
|
|
|
3e3291 |
+ tret2=clock_gettime(d->private_data->clock,&tv2);
|
|
|
3e3291 |
errno=0;
|
|
|
3e3291 |
status = read(d->cdda_fd, sg_hd, SG_OFF + out_size);
|
|
|
3e3291 |
@@ -314,5 +314,5 @@
|
|
|
3e3291 |
long i,flag=0;
|
|
|
3e3291 |
for(i=in_size;i
|
|
|
3e3291 |
- if(d->private->sg_buffer[i]!=bytefill){
|
|
|
3e3291 |
+ if(d->private_data->sg_buffer[i]!=bytefill){
|
|
|
3e3291 |
flag=1;
|
|
|
3e3291 |
break;
|
|
|
3e3291 |
@@ -327,7 +327,7 @@
|
|
|
3e3291 |
errno=0;
|
|
|
3e3291 |
if(tret1<0 || tret2<0){
|
|
|
3e3291 |
- d->private->last_milliseconds=-1;
|
|
|
3e3291 |
+ d->private_data->last_milliseconds=-1;
|
|
|
3e3291 |
}else{
|
|
|
3e3291 |
- d->private->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000 + (tv2.tv_nsec-tv1.tv_nsec)/1000000;
|
|
|
3e3291 |
+ d->private_data->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000 + (tv2.tv_nsec-tv1.tv_nsec)/1000000;
|
|
|
3e3291 |
}
|
|
|
3e3291 |
return(0);
|
|
|
3e3291 |
@@ -348,5 +348,5 @@
|
|
|
3e3291 |
memset(&hdr,0,sizeof(hdr));
|
|
|
3e3291 |
memset(sense,0,sizeof(sense));
|
|
|
3e3291 |
- memcpy(d->private->sg_buffer,cmd+cmd_len,in_size);
|
|
|
3e3291 |
+ memcpy(d->private_data->sg_buffer,cmd+cmd_len,in_size);
|
|
|
3e3291 |
|
|
|
3e3291 |
hdr.cmdp = cmd;
|
|
|
3e3291 |
@@ -356,5 +356,5 @@
|
|
|
3e3291 |
hdr.timeout = 50000;
|
|
|
3e3291 |
hdr.interface_id = 'S';
|
|
|
3e3291 |
- hdr.dxferp = d->private->sg_buffer;
|
|
|
3e3291 |
+ hdr.dxferp = d->private_data->sg_buffer;
|
|
|
3e3291 |
hdr.flags = SG_FLAG_DIRECT_IO; /* direct IO if we can get it */
|
|
|
3e3291 |
|
|
|
3e3291 |
@@ -401,5 +401,5 @@
|
|
|
3e3291 |
long i,flag=0;
|
|
|
3e3291 |
for(i=in_size;i
|
|
|
3e3291 |
- if(d->private->sg_buffer[i]!=bytefill){
|
|
|
3e3291 |
+ if(d->private_data->sg_buffer[i]!=bytefill){
|
|
|
3e3291 |
flag=1;
|
|
|
3e3291 |
break;
|
|
|
3e3291 |
@@ -413,5 +413,5 @@
|
|
|
3e3291 |
|
|
|
3e3291 |
/* Can't rely on .duration because we can't be certain kernel has HZ set to something useful */
|
|
|
3e3291 |
- /* d->private->last_milliseconds = hdr.duration; */
|
|
|
3e3291 |
+ /* d->private_data->last_milliseconds = hdr.duration; */
|
|
|
3e3291 |
|
|
|
3e3291 |
errno = 0;
|
|
|
3e3291 |
@@ -446,7 +446,7 @@
|
|
|
3e3291 |
handle_scsi_cmd(d, cmd, 6, 0, 56, 0,0, sense);
|
|
|
3e3291 |
|
|
|
3e3291 |
- key = d->private->sg_buffer[2] & 0xf;
|
|
|
3e3291 |
- ASC = d->private->sg_buffer[12];
|
|
|
3e3291 |
- ASCQ = d->private->sg_buffer[13];
|
|
|
3e3291 |
+ key = d->private_data->sg_buffer[2] & 0xf;
|
|
|
3e3291 |
+ ASC = d->private_data->sg_buffer[12];
|
|
|
3e3291 |
+ ASCQ = d->private_data->sg_buffer[13];
|
|
|
3e3291 |
|
|
|
3e3291 |
if(key == 2 && ASC == 4 && ASCQ == 1) return 0;
|
|
|
3e3291 |
@@ -493,5 +493,5 @@
|
|
|
3e3291 |
|
|
|
3e3291 |
{
|
|
|
3e3291 |
- unsigned char *b=d->private->sg_buffer;
|
|
|
3e3291 |
+ unsigned char *b=d->private_data->sg_buffer;
|
|
|
3e3291 |
if(b[0])return(1); /* Handles only up to 256 bytes */
|
|
|
3e3291 |
if(b[6])return(1); /* Handles only up to 256 bytes */
|
|
|
3e3291 |
@@ -605,6 +605,6 @@
|
|
|
3e3291 |
if(mode_sense(d,12,0x01))return(-1);
|
|
|
3e3291 |
|
|
|
3e3291 |
- d->orgdens = d->private->sg_buffer[4];
|
|
|
3e3291 |
- return(d->orgsize = ((int)(d->private->sg_buffer[10])<<8)+d->private->sg_buffer[11]);
|
|
|
3e3291 |
+ d->orgdens = d->private_data->sg_buffer[4];
|
|
|
3e3291 |
+ return(d->orgsize = ((int)(d->private_data->sg_buffer[10])<<8)+d->private_data->sg_buffer[11]);
|
|
|
3e3291 |
}
|
|
|
3e3291 |
|
|
|
3e3291 |
@@ -665,6 +665,6 @@
|
|
|
3e3291 |
}
|
|
|
3e3291 |
|
|
|
3e3291 |
- first=d->private->sg_buffer[2];
|
|
|
3e3291 |
- last=d->private->sg_buffer[3];
|
|
|
3e3291 |
+ first=d->private_data->sg_buffer[2];
|
|
|
3e3291 |
+ last=d->private_data->sg_buffer[3];
|
|
|
3e3291 |
tracks=last-first+1;
|
|
|
3e3291 |
|
|
|
3e3291 |
@@ -684,5 +684,5 @@
|
|
|
3e3291 |
}
|
|
|
3e3291 |
{
|
|
|
3e3291 |
- scsi_TOC *toc=(scsi_TOC *)(d->private->sg_buffer+4);
|
|
|
3e3291 |
+ scsi_TOC *toc=(scsi_TOC *)(d->private_data->sg_buffer+4);
|
|
|
3e3291 |
|
|
|
3e3291 |
d->disc_toc[i-first].bFlags=toc->bFlags;
|
|
|
3e3291 |
@@ -705,5 +705,5 @@
|
|
|
3e3291 |
}
|
|
|
3e3291 |
{
|
|
|
3e3291 |
- scsi_TOC *toc=(scsi_TOC *)(d->private->sg_buffer+4);
|
|
|
3e3291 |
+ scsi_TOC *toc=(scsi_TOC *)(d->private_data->sg_buffer+4);
|
|
|
3e3291 |
|
|
|
3e3291 |
d->disc_toc[i-first].bFlags=toc->bFlags;
|
|
|
3e3291 |
@@ -739,5 +739,5 @@
|
|
|
3e3291 |
|
|
|
3e3291 |
/* copy to our structure and convert start sector */
|
|
|
3e3291 |
- tracks = d->private->sg_buffer[1];
|
|
|
3e3291 |
+ tracks = d->private_data->sg_buffer[1];
|
|
|
3e3291 |
if (tracks > MAXTRK) {
|
|
|
3e3291 |
cderror(d,"003: CDROM reporting illegal number of tracks\n");
|
|
|
3e3291 |
@@ -755,31 +755,31 @@
|
|
|
3e3291 |
}
|
|
|
3e3291 |
|
|
|
3e3291 |
- d->disc_toc[i].bFlags = d->private->sg_buffer[10];
|
|
|
3e3291 |
+ d->disc_toc[i].bFlags = d->private_data->sg_buffer[10];
|
|
|
3e3291 |
d->disc_toc[i].bTrack = i + 1;
|
|
|
3e3291 |
|
|
|
3e3291 |
d->disc_toc[i].dwStartSector= d->adjust_ssize *
|
|
|
3e3291 |
- (((signed char)(d->private->sg_buffer[2])<<24) |
|
|
|
3e3291 |
- (d->private->sg_buffer[3]<<16)|
|
|
|
3e3291 |
- (d->private->sg_buffer[4]<<8)|
|
|
|
3e3291 |
- (d->private->sg_buffer[5]));
|
|
|
3e3291 |
+ (((signed char)(d->private_data->sg_buffer[2])<<24) |
|
|
|
3e3291 |
+ (d->private_data->sg_buffer[3]<<16)|
|
|
|
3e3291 |
+ (d->private_data->sg_buffer[4]<<8)|
|
|
|
3e3291 |
+ (d->private_data->sg_buffer[5]));
|
|
|
3e3291 |
}
|
|
|
3e3291 |
|
|
|
3e3291 |
d->disc_toc[i].bFlags = 0;
|
|
|
3e3291 |
d->disc_toc[i].bTrack = i + 1;
|
|
|
3e3291 |
- memcpy (&foo, d->private->sg_buffer+2, 4);
|
|
|
3e3291 |
- memcpy (&bar, d->private->sg_buffer+6, 4);
|
|
|
3e3291 |
+ memcpy (&foo, d->private_data->sg_buffer+2, 4);
|
|
|
3e3291 |
+ memcpy (&bar, d->private_data->sg_buffer+6, 4);
|
|
|
3e3291 |
d->disc_toc[i].dwStartSector = d->adjust_ssize * (be32_to_cpu(foo) +
|
|
|
3e3291 |
be32_to_cpu(bar));
|
|
|
3e3291 |
|
|
|
3e3291 |
d->disc_toc[i].dwStartSector= d->adjust_ssize *
|
|
|
3e3291 |
- ((((signed char)(d->private->sg_buffer[2])<<24) |
|
|
|
3e3291 |
- (d->private->sg_buffer[3]<<16)|
|
|
|
3e3291 |
- (d->private->sg_buffer[4]<<8)|
|
|
|
3e3291 |
- (d->private->sg_buffer[5]))+
|
|
|
3e3291 |
+ ((((signed char)(d->private_data->sg_buffer[2])<<24) |
|
|
|
3e3291 |
+ (d->private_data->sg_buffer[3]<<16)|
|
|
|
3e3291 |
+ (d->private_data->sg_buffer[4]<<8)|
|
|
|
3e3291 |
+ (d->private_data->sg_buffer[5]))+
|
|
|
3e3291 |
|
|
|
3e3291 |
- ((((signed char)(d->private->sg_buffer[6])<<24) |
|
|
|
3e3291 |
- (d->private->sg_buffer[7]<<16)|
|
|
|
3e3291 |
- (d->private->sg_buffer[8]<<8)|
|
|
|
3e3291 |
- (d->private->sg_buffer[9]))));
|
|
|
3e3291 |
+ ((((signed char)(d->private_data->sg_buffer[6])<<24) |
|
|
|
3e3291 |
+ (d->private_data->sg_buffer[7]<<16)|
|
|
|
3e3291 |
+ (d->private_data->sg_buffer[8]<<8)|
|
|
|
3e3291 |
+ (d->private_data->sg_buffer[9]))));
|
|
|
3e3291 |
|
|
|
3e3291 |
|
|
|
3e3291 |
@@ -818,5 +818,5 @@
|
|
|
3e3291 |
if((ret=handle_scsi_cmd(d,cmd,10,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
|
|
|
3e3291 |
return(ret);
|
|
|
3e3291 |
- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
|
|
|
3e3291 |
+ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
|
|
|
3e3291 |
return(0);
|
|
|
3e3291 |
}
|
|
|
3e3291 |
@@ -837,5 +837,5 @@
|
|
|
3e3291 |
if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
|
|
|
3e3291 |
return(ret);
|
|
|
3e3291 |
- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
|
|
|
3e3291 |
+ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
|
|
|
3e3291 |
return(0);
|
|
|
3e3291 |
}
|
|
|
3e3291 |
@@ -855,5 +855,5 @@
|
|
|
3e3291 |
if((ret=handle_scsi_cmd(d,cmd,10,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
|
|
|
3e3291 |
return(ret);
|
|
|
3e3291 |
- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
|
|
|
3e3291 |
+ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
|
|
|
3e3291 |
return(0);
|
|
|
3e3291 |
}
|
|
|
3e3291 |
@@ -873,5 +873,5 @@
|
|
|
3e3291 |
if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
|
|
|
3e3291 |
return(ret);
|
|
|
3e3291 |
- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
|
|
|
3e3291 |
+ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
|
|
|
3e3291 |
return(0);
|
|
|
3e3291 |
}
|
|
|
3e3291 |
@@ -891,5 +891,5 @@
|
|
|
3e3291 |
if((ret=handle_scsi_cmd(d,cmd,10,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
|
|
|
3e3291 |
return(ret);
|
|
|
3e3291 |
- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
|
|
|
3e3291 |
+ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
|
|
|
3e3291 |
return(0);
|
|
|
3e3291 |
}
|
|
|
3e3291 |
@@ -909,5 +909,5 @@
|
|
|
3e3291 |
if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
|
|
|
3e3291 |
return(ret);
|
|
|
3e3291 |
- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
|
|
|
3e3291 |
+ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
|
|
|
3e3291 |
return(0);
|
|
|
3e3291 |
}
|
|
|
3e3291 |
@@ -923,5 +923,5 @@
|
|
|
3e3291 |
if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
|
|
|
3e3291 |
return(ret);
|
|
|
3e3291 |
- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
|
|
|
3e3291 |
+ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
|
|
|
3e3291 |
return(0);
|
|
|
3e3291 |
}
|
|
|
3e3291 |
@@ -937,5 +937,5 @@
|
|
|
3e3291 |
if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
|
|
|
3e3291 |
return(ret);
|
|
|
3e3291 |
- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
|
|
|
3e3291 |
+ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
|
|
|
3e3291 |
return(0);
|
|
|
3e3291 |
}
|
|
|
3e3291 |
@@ -951,5 +951,5 @@
|
|
|
3e3291 |
if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
|
|
|
3e3291 |
return(ret);
|
|
|
3e3291 |
- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
|
|
|
3e3291 |
+ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
|
|
|
3e3291 |
return(0);
|
|
|
3e3291 |
}
|
|
|
3e3291 |
@@ -965,5 +965,5 @@
|
|
|
3e3291 |
if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
|
|
|
3e3291 |
return(ret);
|
|
|
3e3291 |
- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
|
|
|
3e3291 |
+ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
|
|
|
3e3291 |
return(0);
|
|
|
3e3291 |
}
|
|
|
3e3291 |
@@ -979,5 +979,5 @@
|
|
|
3e3291 |
if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
|
|
|
3e3291 |
return(ret);
|
|
|
3e3291 |
- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
|
|
|
3e3291 |
+ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
|
|
|
3e3291 |
return(0);
|
|
|
3e3291 |
}
|
|
|
3e3291 |
@@ -993,5 +993,5 @@
|
|
|
3e3291 |
if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
|
|
|
3e3291 |
return(ret);
|
|
|
3e3291 |
- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
|
|
|
3e3291 |
+ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
|
|
|
3e3291 |
return(0);
|
|
|
3e3291 |
}
|
|
|
3e3291 |
@@ -1027,5 +1027,5 @@
|
|
|
3e3291 |
if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
|
|
|
3e3291 |
return(ret);
|
|
|
3e3291 |
- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
|
|
|
3e3291 |
+ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
|
|
|
3e3291 |
return(0);
|
|
|
3e3291 |
}
|
|
|
3e3291 |
@@ -1040,5 +1040,5 @@
|
|
|
3e3291 |
if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
|
|
|
3e3291 |
return(ret);
|
|
|
3e3291 |
- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
|
|
|
3e3291 |
+ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
|
|
|
3e3291 |
return(0);
|
|
|
3e3291 |
}
|
|
|
3e3291 |
@@ -1053,5 +1053,5 @@
|
|
|
3e3291 |
if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
|
|
|
3e3291 |
return(ret);
|
|
|
3e3291 |
- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
|
|
|
3e3291 |
+ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
|
|
|
3e3291 |
return(0);
|
|
|
3e3291 |
}
|
|
|
3e3291 |
@@ -1276,5 +1276,5 @@
|
|
|
3e3291 |
long i;
|
|
|
3e3291 |
for(i=2351;i>=0;i--)
|
|
|
3e3291 |
- if(d->private->sg_buffer[i]!=(unsigned char)'\177')
|
|
|
3e3291 |
+ if(d->private_data->sg_buffer[i]!=(unsigned char)'\177')
|
|
|
3e3291 |
return(((i+3)>>2)<<2);
|
|
|
3e3291 |
|
|
|
3e3291 |
@@ -1285,5 +1285,5 @@
|
|
|
3e3291 |
long i,flag=0;
|
|
|
3e3291 |
for(i=0;i<2352;i++)
|
|
|
3e3291 |
- if(d->private->sg_buffer[i]!=0){
|
|
|
3e3291 |
+ if(d->private_data->sg_buffer[i]!=0){
|
|
|
3e3291 |
flag=1;
|
|
|
3e3291 |
break;
|
|
|
3e3291 |
@@ -1622,5 +1622,5 @@
|
|
|
3e3291 |
if(mode_sense(d,22,0x2A)==0){
|
|
|
3e3291 |
|
|
|
3e3291 |
- b=d->private->sg_buffer;
|
|
|
3e3291 |
+ b=d->private_data->sg_buffer;
|
|
|
3e3291 |
b+=b[3]+4;
|
|
|
3e3291 |
|
|
|
3e3291 |
@@ -1670,5 +1670,5 @@
|
|
|
3e3291 |
return(NULL);
|
|
|
3e3291 |
}
|
|
|
3e3291 |
- return (d->private->sg_buffer);
|
|
|
3e3291 |
+ return (d->private_data->sg_buffer);
|
|
|
3e3291 |
}
|
|
|
3e3291 |
|
|
|
3e3291 |
@@ -1726,6 +1726,6 @@
|
|
|
3e3291 |
|
|
|
3e3291 |
d->error_retry=1;
|
|
|
3e3291 |
- d->private->sg_hd=realloc(d->private->sg_hd,d->nsectors*CD_FRAMESIZE_RAW + SG_OFF + 128);
|
|
|
3e3291 |
- d->private->sg_buffer=((unsigned char *)d->private->sg_hd)+SG_OFF;
|
|
|
3e3291 |
+ d->private_data->sg_hd=realloc(d->private_data->sg_hd,d->nsectors*CD_FRAMESIZE_RAW + SG_OFF + 128);
|
|
|
3e3291 |
+ d->private_data->sg_buffer=((unsigned char *)d->private_data->sg_hd)+SG_OFF;
|
|
|
3e3291 |
d->report_all=1;
|
|
|
3e3291 |
return(0);
|
|
|
3e3291 |
Index: /trunk/cdparanoia/interface/cooked_interface.c
|
|
|
3e3291 |
===================================================================
|
|
|
3e3291 |
--- /trunk/cdparanoia/interface/cooked_interface.c (revision 15202)
|
|
|
3e3291 |
+++ /trunk/cdparanoia/interface/cooked_interface.c (revision 15338)
|
|
|
3e3291 |
@@ -14,11 +14,11 @@
|
|
|
3e3291 |
struct timespec tv1;
|
|
|
3e3291 |
struct timespec tv2;
|
|
|
3e3291 |
- int ret1=clock_gettime(d->private->clock,&tv1);
|
|
|
3e3291 |
+ int ret1=clock_gettime(d->private_data->clock,&tv1);
|
|
|
3e3291 |
int ret2=ioctl(fd, command,arg);
|
|
|
3e3291 |
- int ret3=clock_gettime(d->private->clock,&tv2);
|
|
|
3e3291 |
+ int ret3=clock_gettime(d->private_data->clock,&tv2);
|
|
|
3e3291 |
if(ret1<0 || ret3<0){
|
|
|
3e3291 |
- d->private->last_milliseconds=-1;
|
|
|
3e3291 |
+ d->private_data->last_milliseconds=-1;
|
|
|
3e3291 |
}else{
|
|
|
3e3291 |
- d->private->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000. + (tv2.tv_nsec-tv1.tv_nsec)/1000000.;
|
|
|
3e3291 |
+ d->private_data->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000. + (tv2.tv_nsec-tv1.tv_nsec)/1000000.;
|
|
|
3e3291 |
}
|
|
|
3e3291 |
return ret2;
|
|
|
3e3291 |
Index: /trunk/cdparanoia/interface/scan_devices.c
|
|
|
3e3291 |
===================================================================
|
|
|
3e3291 |
--- /trunk/cdparanoia/interface/scan_devices.c (revision 15202)
|
|
|
3e3291 |
+++ /trunk/cdparanoia/interface/scan_devices.c (revision 15338)
|
|
|
3e3291 |
@@ -265,9 +265,9 @@
|
|
|
3e3291 |
d->bigendianp=-1; /* We don't know yet... */
|
|
|
3e3291 |
d->nsectors=-1;
|
|
|
3e3291 |
- d->private=calloc(1,sizeof(*d->private));
|
|
|
3e3291 |
+ d->private_data=calloc(1,sizeof(*d->private_data));
|
|
|
3e3291 |
{
|
|
|
3e3291 |
/* goddamnit */
|
|
|
3e3291 |
struct timespec tv;
|
|
|
3e3291 |
- d->private->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC);
|
|
|
3e3291 |
+ d->private_data->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC);
|
|
|
3e3291 |
}
|
|
|
3e3291 |
idmessage(messagedest,messages,"\t\tCDROM sensed: %s\n",description);
|
|
|
3e3291 |
@@ -675,13 +675,13 @@
|
|
|
3e3291 |
d->nsectors=-1;
|
|
|
3e3291 |
d->messagedest = messagedest;
|
|
|
3e3291 |
- d->private=calloc(1,sizeof(*d->private));
|
|
|
3e3291 |
+ d->private_data=calloc(1,sizeof(*d->private_data));
|
|
|
3e3291 |
{
|
|
|
3e3291 |
/* goddamnit */
|
|
|
3e3291 |
struct timespec tv;
|
|
|
3e3291 |
- d->private->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC);
|
|
|
3e3291 |
+ d->private_data->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC);
|
|
|
3e3291 |
}
|
|
|
3e3291 |
if(use_sgio){
|
|
|
3e3291 |
d->interface=SGIO_SCSI;
|
|
|
3e3291 |
- d->private->sg_buffer=(unsigned char *)(d->private->sg_hd=malloc(MAX_BIG_BUFF_SIZE));
|
|
|
3e3291 |
+ d->private_data->sg_buffer=(unsigned char *)(d->private_data->sg_hd=malloc(MAX_BIG_BUFF_SIZE));
|
|
|
3e3291 |
g_fd=d->cdda_fd=dup(d->ioctl_fd);
|
|
|
3e3291 |
}else{
|
|
|
3e3291 |
@@ -697,6 +697,6 @@
|
|
|
3e3291 |
|
|
|
3e3291 |
/* malloc our big buffer for scsi commands */
|
|
|
3e3291 |
- d->private->sg_hd=malloc(MAX_BIG_BUFF_SIZE);
|
|
|
3e3291 |
- d->private->sg_buffer=((unsigned char *)d->private->sg_hd)+SG_OFF;
|
|
|
3e3291 |
+ d->private_data->sg_hd=malloc(MAX_BIG_BUFF_SIZE);
|
|
|
3e3291 |
+ d->private_data->sg_buffer=((unsigned char *)d->private_data->sg_hd)+SG_OFF;
|
|
|
3e3291 |
}
|
|
|
3e3291 |
|
|
|
3e3291 |
@@ -773,7 +773,7 @@
|
|
|
3e3291 |
if(g_fd!=-1)close(g_fd);
|
|
|
3e3291 |
if(d){
|
|
|
3e3291 |
- if(d->private){
|
|
|
3e3291 |
- if(d->private->sg_hd)free(d->private->sg_hd);
|
|
|
3e3291 |
- free(d->private);
|
|
|
3e3291 |
+ if(d->private_data){
|
|
|
3e3291 |
+ if(d->private_data->sg_hd)free(d->private_data->sg_hd);
|
|
|
3e3291 |
+ free(d->private_data);
|
|
|
3e3291 |
}
|
|
|
3e3291 |
free(d);
|
|
|
3e3291 |
@@ -822,5 +822,5 @@
|
|
|
3e3291 |
d->bigendianp=-1; /* We don't know yet... */
|
|
|
3e3291 |
d->nsectors=-1;
|
|
|
3e3291 |
- d->private=calloc(1,sizeof(*d->private));
|
|
|
3e3291 |
+ d->private_data=calloc(1,sizeof(*d->private_data));
|
|
|
3e3291 |
d->drive_model=copystring("File based test interface");
|
|
|
3e3291 |
idmessage(messagedest,messages,"\t\tCDROM sensed: %s\n",d->drive_model);
|