4 #include <minix/drivers.h>
5 #include <minix/chardriver.h>
6 #include <sys/ioc_sound.h>
10 int drv_init_hw(void);
12 int drv_start(int sub_dev
, int DmaMode
);
13 int drv_stop(int sub_dev
);
14 int drv_set_dma(u32_t dma
, u32_t length
, int chan
);
15 int drv_reenable_int(int chan
);
16 int drv_int_sum(void);
17 int drv_int(int sub_dev
);
18 int drv_pause(int chan
);
19 int drv_resume(int chan
);
20 int drv_io_ctl(int request
, void * val
, int * len
, int sub_dev
);
21 int drv_get_irq(char *irq
);
22 int drv_get_frag_size(u32_t
*frag_size
, int sub_dev
);
26 /* runtime status fields */
34 int Nr
; /* sub device number */
35 int Opened
; /* sub device opened */
36 int DmaBusy
; /* is dma busy? */
37 int DmaMode
; /* DEV_WRITE / DEV_READ */
38 int DmaReadNext
; /* current dma buffer */
39 int DmaFillNext
; /* next dma buffer to fill */
41 int BufReadNext
; /* start of extra circular buffer */
42 int BufFillNext
; /* end of extra circular buffer */
44 int RevivePending
; /* process waiting for this dev? */
45 int ReviveStatus
; /* return val when proc unblocked */
46 endpoint_t ReviveProcNr
; /* the process to unblock */
47 cp_grant_id_t ReviveGrant
; /* grant id associated with io */
48 void *UserBuf
; /* address of user's data buffer */
49 int ReadyToRevive
; /* are we ready to revive process?*/
50 endpoint_t SourceProcNr
; /* process to send notify to (FS) */
51 u32_t FragSize
; /* dma fragment size */
52 char *DmaBuf
; /* the dma buffer; extra space for
54 phys_bytes DmaPhys
; /* physical address of dma buffer */
55 char* DmaPtr
; /* pointer to aligned dma buffer */
56 int OutOfData
; /* all buffers empty? */
57 char *ExtraBuf
; /* don't use extra buffer;just
58 declare a pointer to supress
76 EXTERN sub_dev_t sub_dev
[];
77 EXTERN special_file_t special_file
[];
79 /* Number of bytes you can DMA before hitting a 64K boundary: */
80 #define dma_bytes_left(phys) \
81 ((unsigned) (sizeof(int) == 2 ? 0 : 0x10000) - (unsigned) ((phys) & 0xFFFF))
90 #endif /* AUDIO_FW_H */