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(unsigned long 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 endpoint_t ReviveProcNr
; /* the process to unblock */
46 cdev_id_t ReviveId
; /* request ID */
47 cp_grant_id_t ReviveGrant
; /* grant id associated with io */
48 endpoint_t SourceProcNr
; /* process to send notify to (FS) */
49 u32_t FragSize
; /* dma fragment size */
50 char *DmaBuf
; /* the dma buffer; extra space for
52 phys_bytes DmaPhys
; /* physical address of dma buffer */
53 char* DmaPtr
; /* pointer to aligned dma buffer */
54 int OutOfData
; /* all buffers empty? */
55 char *ExtraBuf
; /* don't use extra buffer;just
56 declare a pointer to supress
74 EXTERN sub_dev_t sub_dev
[];
75 EXTERN special_file_t special_file
[];
77 /* Number of bytes you can DMA before hitting a 64K boundary: */
78 #define dma_bytes_left(phys) \
79 ((unsigned) (sizeof(int) == 2 ? 0 : 0x10000) - (unsigned) ((phys) & 0xFFFF))
87 #endif /* AUDIO_FW_H */