Add play_msf command and MSF variants. This is SCSI2 stuff and is needed for many flavors of player utilities.

This commit is contained in:
brezak 1993-08-04 17:26:20 +00:00
parent 91d4aa53f0
commit 80a965ba28
3 changed files with 132 additions and 6 deletions

View File

@ -13,7 +13,7 @@
* on the understanding that TFS is not responsible for the correct
* functioning of this software in any circumstances.
*
* $Id: cd.c,v 1.16 1993/08/01 19:26:17 mycroft Exp $
* $Id: cd.c,v 1.17 1993/08/04 17:26:23 brezak Exp $
*/
#define SPLCD splbio
@ -698,6 +698,27 @@ cdioctl(dev_t dev, int cmd, caddr_t addr, int flag)
));
}
break;
case CDIOCPLAYMSF:
{
struct ioc_play_msf *args
= (struct ioc_play_msf *)addr;
struct cd_mode_data data;
if(error = cd_get_mode(unit,&data,AUDIO_PAGE))
break;
data.page.audio.sotc = 0;
data.page.audio.immed = 1;
if(error = cd_set_mode(unit,&data))
break;
return(cd_play_msf(unit
,args->start.minute
,args->start.second
,args->start.frame
,args->end.minute
,args->end.second
,args->end.frame
));
}
break;
case CDIOCPLAYBLOCKS:
{
struct ioc_play_blocks *args
@ -1168,6 +1189,33 @@ int unit,strack,sindex,etrack,eindex;
return(retval);
}
/*******************************************************\
* Get scsi driver to send a "start playing" command *
\*******************************************************/
cd_play_msf(unit,sm,ss,sf,em,es,ef)
int unit;
u_char sm,ss,sf,em,es,ef;
{
struct scsi_play_msf scsi_cmd;
int retval;
bzero((struct scsi_generic *)&scsi_cmd, sizeof(scsi_cmd));
scsi_cmd.op_code = PLAY_MSF;
scsi_cmd.start_m = sm;
scsi_cmd.start_s = ss;
scsi_cmd.start_f = sf;
scsi_cmd.end_m = em;
scsi_cmd.end_s = es;
scsi_cmd.end_f = ef;
retval = cd_scsi_cmd(unit,
(struct scsi_generic *)&scsi_cmd,
sizeof(scsi_cmd),
0,
0,
20000, /* should be immed */
0);
return(retval);
}
/*******************************************************\
* Get scsi driver to send a "start up" command *
\*******************************************************/
cd_pause(unit,go)

View File

@ -13,7 +13,7 @@
* on the understanding that TFS is not responsible for the correct
* functioning of this software in any circumstances.
*
* $Id: cd.c,v 1.16 1993/08/01 19:26:17 mycroft Exp $
* $Id: cd.c,v 1.17 1993/08/04 17:26:23 brezak Exp $
*/
#define SPLCD splbio
@ -698,6 +698,27 @@ cdioctl(dev_t dev, int cmd, caddr_t addr, int flag)
));
}
break;
case CDIOCPLAYMSF:
{
struct ioc_play_msf *args
= (struct ioc_play_msf *)addr;
struct cd_mode_data data;
if(error = cd_get_mode(unit,&data,AUDIO_PAGE))
break;
data.page.audio.sotc = 0;
data.page.audio.immed = 1;
if(error = cd_set_mode(unit,&data))
break;
return(cd_play_msf(unit
,args->start.minute
,args->start.second
,args->start.frame
,args->end.minute
,args->end.second
,args->end.frame
));
}
break;
case CDIOCPLAYBLOCKS:
{
struct ioc_play_blocks *args
@ -1168,6 +1189,33 @@ int unit,strack,sindex,etrack,eindex;
return(retval);
}
/*******************************************************\
* Get scsi driver to send a "start playing" command *
\*******************************************************/
cd_play_msf(unit,sm,ss,sf,em,es,ef)
int unit;
u_char sm,ss,sf,em,es,ef;
{
struct scsi_play_msf scsi_cmd;
int retval;
bzero((struct scsi_generic *)&scsi_cmd, sizeof(scsi_cmd));
scsi_cmd.op_code = PLAY_MSF;
scsi_cmd.start_m = sm;
scsi_cmd.start_s = ss;
scsi_cmd.start_f = sf;
scsi_cmd.end_m = em;
scsi_cmd.end_s = es;
scsi_cmd.end_f = ef;
retval = cd_scsi_cmd(unit,
(struct scsi_generic *)&scsi_cmd,
sizeof(scsi_cmd),
0,
0,
20000, /* should be immed */
0);
return(retval);
}
/*******************************************************\
* Get scsi driver to send a "start up" command *
\*******************************************************/
cd_pause(unit,go)

View File

@ -1,5 +1,5 @@
/*
* $Id: cdio.h,v 1.3 1993/05/20 16:21:53 cgd Exp $
* cdio.h,v 1.3 1993/05/20 16:21:53 cgd Exp
*/
#ifndef _SYS_CDIO_H_
@ -7,13 +7,25 @@
/* Shared between kernel & process */
struct cd_msf {
u_char __xxx;
u_char minute;
u_char second;
u_char frame;
};
struct cd_toc_entry {
u_char :8;
u_char control:4;
u_char addr_type:4;
u_char track;
u_char :8;
u_char addr[4];
union {
u_char block[4];
struct cd_msf msf;
} un_addr;
#define toce_addr un_addr.block
#define toce_msf un_addr.msf
};
struct cd_sub_channel_header {
@ -34,8 +46,18 @@ struct cd_sub_channel_position_data {
u_char addr_type:4;
u_char track_number;
u_char index_number;
u_char absaddr[4];
u_char reladdr[4];
union {
u_char addr[4];
struct cd_msf msf;
} un_abs;
union {
u_char addr[4];
struct cd_msf msf;
} un_rel;
#define cdscp_absaddr un_abs.addr
#define cdscp_absmsf un_abs.msf
#define cdscp_reladdr un_rel.addr
#define cdscp_relmsf un_rel.msf
};
struct cd_sub_channel_media_catalog {
@ -86,6 +108,14 @@ struct ioc_play_blocks
};
#define CDIOCPLAYBLOCKS _IOW('c',2,struct ioc_play_blocks)
struct ioc_play_msf
{
struct cd_msf start;
struct cd_msf end;
};
#define CDIOCPLAYMSF _IOW('c',25,struct ioc_play_msf)
struct ioc_read_subchannel {
u_char address_format;
#define CD_LBA_FORMAT 1