scd.c (8876) | scd.c (10624) |
---|---|
1/*- 2 * Copyright (c) 1995 Mikael Hybsch 3 * All rights reserved. 4 * 5 * Portions of this file are copied from mcd.c 6 * which has the following copyrights: 7 * 8 * Copyright 1993 by Holger Veit (data part) --- 27 unchanged lines hidden (view full) --- 36 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 37 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 39 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 * 41 */ 42 43 | 1/*- 2 * Copyright (c) 1995 Mikael Hybsch 3 * All rights reserved. 4 * 5 * Portions of this file are copied from mcd.c 6 * which has the following copyrights: 7 * 8 * Copyright 1993 by Holger Veit (data part) --- 27 unchanged lines hidden (view full) --- 36 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 37 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 39 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 * 41 */ 42 43 |
44/* $Id: scd.c,v 1.4 1995/05/09 12:25:58 rgrimes Exp $ */ | 44/* $Id: scd.c,v 1.5 1995/05/30 08:03:02 rgrimes Exp $ */ |
45 46/* Please send any comments to micke@dynas.se */ 47 48#define SCD_DEBUG 0 49 50#include "scd.h" 51#if NSCD > 0 52#include <sys/types.h> --- 84 unchanged lines hidden (view full) --- 137 struct ioc_play_msf last_play; 138 139 short audio_status; 140 struct buf head; /* head of buf queue */ 141 struct scd_mbx mbx; 142} scd_data[NSCD]; 143 144/* prototypes */ | 45 46/* Please send any comments to micke@dynas.se */ 47 48#define SCD_DEBUG 0 49 50#include "scd.h" 51#if NSCD > 0 52#include <sys/types.h> --- 84 unchanged lines hidden (view full) --- 137 struct ioc_play_msf last_play; 138 139 short audio_status; 140 struct buf head; /* head of buf queue */ 141 struct scd_mbx mbx; 142} scd_data[NSCD]; 143 144/* prototypes */ |
145int scdopen(dev_t dev); 146int scdclose(dev_t dev); | 145int scdopen(dev_t dev, int flags, int fmt, struct proc *p); 146int scdclose(dev_t dev, int flags, int fmt, struct proc *p); |
147void scdstrategy(struct buf *bp); | 147void scdstrategy(struct buf *bp); |
148int scdioctl(dev_t dev, int cmd, caddr_t addr, int flags); | 148int scdioctl(dev_t dev, int cmd, caddr_t addr, int flags, struct proc *p); |
149int scdsize(dev_t dev); 150 151static int bcd2bin(bcd_t b); 152static bcd_t bin2bcd(int b); 153static void hsg2msf(int hsg, bcd_t *msf); 154static int msf2hsg(bcd_t *msf); 155 156static void process_attention(unsigned unit); --- 68 unchanged lines hidden (view full) --- 225 226 cd->flags = SCDINIT; 227 cd->audio_status = CD_AS_AUDIO_INVALID; 228 229 return 1; 230} 231 232int | 149int scdsize(dev_t dev); 150 151static int bcd2bin(bcd_t b); 152static bcd_t bin2bcd(int b); 153static void hsg2msf(int hsg, bcd_t *msf); 154static int msf2hsg(bcd_t *msf); 155 156static void process_attention(unsigned unit); --- 68 unchanged lines hidden (view full) --- 225 226 cd->flags = SCDINIT; 227 cd->audio_status = CD_AS_AUDIO_INVALID; 228 229 return 1; 230} 231 232int |
233scdopen(dev_t dev) | 233scdopen(dev_t dev, int flags, int fmt, struct proc *p) |
234{ 235 int unit,part,phys; 236 int rc; 237 struct scd_data *cd; 238 239 unit = scd_unit(dev); 240 if (unit >= NSCD) 241 return ENXIO; --- 36 unchanged lines hidden (view full) --- 278 cd->openflag = 1; 279 cd->flags |= SCDVALID; 280 kdc_scd[unit].kdc_state = DC_BUSY; 281 282 return 0; 283} 284 285int | 234{ 235 int unit,part,phys; 236 int rc; 237 struct scd_data *cd; 238 239 unit = scd_unit(dev); 240 if (unit >= NSCD) 241 return ENXIO; --- 36 unchanged lines hidden (view full) --- 278 cd->openflag = 1; 279 cd->flags |= SCDVALID; 280 kdc_scd[unit].kdc_state = DC_BUSY; 281 282 return 0; 283} 284 285int |
286scdclose(dev_t dev) | 286scdclose(dev_t dev, int flags, int fmt, struct proc *p) |
287{ 288 int unit,part,phys; 289 struct scd_data *cd; 290 int rlen; 291 char rdata[10]; 292 293 unit = scd_unit(dev); 294 if (unit >= NSCD) --- 119 unchanged lines hidden (view full) --- 414 cd->mbx.p_offset = p->p_offset; 415 splx(s); 416 417 scd_doread(SCD_S_BEGIN,&(cd->mbx)); 418 return; 419} 420 421int | 287{ 288 int unit,part,phys; 289 struct scd_data *cd; 290 int rlen; 291 char rdata[10]; 292 293 unit = scd_unit(dev); 294 if (unit >= NSCD) --- 119 unchanged lines hidden (view full) --- 414 cd->mbx.p_offset = p->p_offset; 415 splx(s); 416 417 scd_doread(SCD_S_BEGIN,&(cd->mbx)); 418 return; 419} 420 421int |
422scdioctl(dev_t dev, int cmd, caddr_t addr, int flags) | 422scdioctl(dev_t dev, int cmd, caddr_t addr, int flags, struct proc *p) |
423{ 424 struct scd_data *cd; 425 int unit,part; 426 427 unit = scd_unit(dev); 428 part = scd_part(dev); 429 cd = scd_data + unit; 430 --- 1113 unchanged lines hidden --- | 423{ 424 struct scd_data *cd; 425 int unit,part; 426 427 unit = scd_unit(dev); 428 part = scd_part(dev); 429 cd = scd_data + unit; 430 --- 1113 unchanged lines hidden --- |