Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions
msnd.h File Reference

Go to the source code of this file.

Data Structures

struct  msnd_fifo
 
struct  multisound_dev
 

Macros

#define VERSION   "0.8.3.1"
 
#define DEFSAMPLERATE   DSP_DEFAULT_SPEED
 
#define DEFSAMPLESIZE   AFMT_U8
 
#define DEFCHANNELS   1
 
#define DEFFIFOSIZE   128
 
#define SNDCARD_MSND   38
 
#define SRAM_BANK_SIZE   0x8000
 
#define SRAM_CNTL_START   0x7F00
 
#define DSP_BASE_ADDR   0x4000
 
#define DSP_BANK_BASE   0x4000
 
#define HP_ICR   0x00
 
#define HP_CVR   0x01
 
#define HP_ISR   0x02
 
#define HP_IVR   0x03
 
#define HP_NU   0x04
 
#define HP_INFO   0x04
 
#define HP_TXH   0x05
 
#define HP_RXH   0x05
 
#define HP_TXM   0x06
 
#define HP_RXM   0x06
 
#define HP_TXL   0x07
 
#define HP_RXL   0x07
 
#define HP_ICR_DEF   0x00
 
#define HP_CVR_DEF   0x12
 
#define HP_ISR_DEF   0x06
 
#define HP_IVR_DEF   0x0f
 
#define HP_NU_DEF   0x00
 
#define HP_IRQM   0x09
 
#define HPR_BLRC   0x08
 
#define HPR_SPR1   0x09
 
#define HPR_SPR2   0x0A
 
#define HPR_TCL0   0x0B
 
#define HPR_TCL1   0x0C
 
#define HPR_TCL2   0x0D
 
#define HPR_TCL3   0x0E
 
#define HPR_TCL4   0x0F
 
#define HPICR_INIT   0x80
 
#define HPICR_HM1   0x40
 
#define HPICR_HM0   0x20
 
#define HPICR_HF1   0x10
 
#define HPICR_HF0   0x08
 
#define HPICR_TREQ   0x02
 
#define HPICR_RREQ   0x01
 
#define HPCVR_HC   0x80
 
#define HPISR_HREQ   0x80
 
#define HPISR_DMA   0x40
 
#define HPISR_HF3   0x10
 
#define HPISR_HF2   0x08
 
#define HPISR_TRDY   0x04
 
#define HPISR_TXDE   0x02
 
#define HPISR_RXDF   0x01
 
#define HPIO_290   0
 
#define HPIO_260   1
 
#define HPIO_250   2
 
#define HPIO_240   3
 
#define HPIO_230   4
 
#define HPIO_220   5
 
#define HPIO_210   6
 
#define HPIO_3E0   7
 
#define HPMEM_NONE   0
 
#define HPMEM_B000   1
 
#define HPMEM_C800   2
 
#define HPMEM_D000   3
 
#define HPMEM_D400   4
 
#define HPMEM_D800   5
 
#define HPMEM_E000   6
 
#define HPMEM_E800   7
 
#define HPIRQ_NONE   0
 
#define HPIRQ_5   1
 
#define HPIRQ_7   2
 
#define HPIRQ_9   3
 
#define HPIRQ_10   4
 
#define HPIRQ_11   5
 
#define HPIRQ_12   6
 
#define HPIRQ_15   7
 
#define HIMT_PLAY_DONE   0x00
 
#define HIMT_RECORD_DONE   0x01
 
#define HIMT_MIDI_EOS   0x02
 
#define HIMT_MIDI_OUT   0x03
 
#define HIMT_MIDI_IN_UCHAR   0x0E
 
#define HIMT_DSP   0x0F
 
#define HDEX_BASE   0x92
 
#define HDEX_PLAY_START   (0 + HDEX_BASE)
 
#define HDEX_PLAY_STOP   (1 + HDEX_BASE)
 
#define HDEX_PLAY_PAUSE   (2 + HDEX_BASE)
 
#define HDEX_PLAY_RESUME   (3 + HDEX_BASE)
 
#define HDEX_RECORD_START   (4 + HDEX_BASE)
 
#define HDEX_RECORD_STOP   (5 + HDEX_BASE)
 
#define HDEX_MIDI_IN_START   (6 + HDEX_BASE)
 
#define HDEX_MIDI_IN_STOP   (7 + HDEX_BASE)
 
#define HDEX_MIDI_OUT_START   (8 + HDEX_BASE)
 
#define HDEX_MIDI_OUT_STOP   (9 + HDEX_BASE)
 
#define HDEX_AUX_REQ   (10 + HDEX_BASE)
 
#define HIWORD(l)   ((WORD)((((DWORD)(l)) >> 16) & 0xFFFF))
 
#define LOWORD(l)   ((WORD)(DWORD)(l))
 
#define HIBYTE(w)   ((BYTE)(((WORD)(w) >> 8) & 0xFF))
 
#define LOBYTE(w)   ((BYTE)(w))
 
#define MAKELONG(low, hi)   ((long)(((WORD)(low))|(((DWORD)((WORD)(hi)))<<16)))
 
#define MAKEWORD(low, hi)   ((WORD)(((BYTE)(low))|(((WORD)((BYTE)(hi)))<<8)))
 
#define PCTODSP_OFFSET(w)   (USHORT)((w)/2)
 
#define PCTODSP_BASED(w)   (USHORT)(((w)/2) + DSP_BASE_ADDR)
 
#define DSPTOPC_BASED(w)   (((w) - DSP_BASE_ADDR) * 2)
 
#define msnd_outb   outb
 
#define msnd_inb   inb
 
#define JQS_wStart   0x00
 
#define JQS_wSize   0x02
 
#define JQS_wHead   0x04
 
#define JQS_wTail   0x06
 
#define JQS__size   0x08
 
#define DAQDS_wStart   0x00
 
#define DAQDS_wSize   0x02
 
#define DAQDS_wFormat   0x04
 
#define DAQDS_wSampleSize   0x06
 
#define DAQDS_wChannels   0x08
 
#define DAQDS_wSampleRate   0x0A
 
#define DAQDS_wIntMsg   0x0C
 
#define DAQDS_wFlags   0x0E
 
#define DAQDS__size   0x10
 
#define F_RESETTING   0
 
#define F_HAVEDIGITAL   1
 
#define F_AUDIO_WRITE_INUSE   2
 
#define F_WRITING   3
 
#define F_WRITEBLOCK   4
 
#define F_WRITEFLUSH   5
 
#define F_AUDIO_READ_INUSE   6
 
#define F_READING   7
 
#define F_READBLOCK   8
 
#define F_EXT_MIDI_INUSE   9
 
#define F_HDR_MIDI_INUSE   10
 
#define F_DISABLE_WRITE_NDELAY   11
 
#define mdelay(a)   udelay((a) * 1000)
 

Typedefs

typedef u8 BYTE
 
typedef u16 USHORT
 
typedef u16 WORD
 
typedef u32 DWORD
 
typedef void __iomemLPDAQD
 
typedef struct multisound_dev multisound_dev_t
 

Functions

int msnd_register (multisound_dev_t *dev)
 
void msnd_unregister (multisound_dev_t *dev)
 
void msnd_init_queue (void __iomem *, int start, int size)
 
void msnd_fifo_init (msnd_fifo *f)
 
void msnd_fifo_free (msnd_fifo *f)
 
int msnd_fifo_alloc (msnd_fifo *f, size_t n)
 
void msnd_fifo_make_empty (msnd_fifo *f)
 
int msnd_fifo_write_io (msnd_fifo *f, char __iomem *buf, size_t len)
 
int msnd_fifo_read_io (msnd_fifo *f, char __iomem *buf, size_t len)
 
int msnd_fifo_write (msnd_fifo *f, const char *buf, size_t len)
 
int msnd_fifo_read (msnd_fifo *f, char *buf, size_t len)
 
int msnd_send_dsp_cmd (multisound_dev_t *dev, BYTE cmd)
 
int msnd_send_word (multisound_dev_t *dev, unsigned char high, unsigned char mid, unsigned char low)
 
int msnd_upload_host (multisound_dev_t *dev, char *bin, int len)
 
int msnd_enable_irq (multisound_dev_t *dev)
 
int msnd_disable_irq (multisound_dev_t *dev)
 

Macro Definition Documentation

#define DAQDS__size   0x10

Definition at line 178 of file msnd.h.

#define DAQDS_wChannels   0x08

Definition at line 174 of file msnd.h.

#define DAQDS_wFlags   0x0E

Definition at line 177 of file msnd.h.

#define DAQDS_wFormat   0x04

Definition at line 172 of file msnd.h.

#define DAQDS_wIntMsg   0x0C

Definition at line 176 of file msnd.h.

#define DAQDS_wSampleRate   0x0A

Definition at line 175 of file msnd.h.

#define DAQDS_wSampleSize   0x06

Definition at line 173 of file msnd.h.

#define DAQDS_wSize   0x02

Definition at line 171 of file msnd.h.

#define DAQDS_wStart   0x00

Definition at line 170 of file msnd.h.

#define DEFCHANNELS   1

Definition at line 35 of file msnd.h.

#define DEFFIFOSIZE   128

Definition at line 37 of file msnd.h.

#define DEFSAMPLERATE   DSP_DEFAULT_SPEED

Definition at line 33 of file msnd.h.

#define DEFSAMPLESIZE   AFMT_U8

Definition at line 34 of file msnd.h.

#define DSP_BANK_BASE   0x4000

Definition at line 45 of file msnd.h.

#define DSP_BASE_ADDR   0x4000

Definition at line 44 of file msnd.h.

#define DSPTOPC_BASED (   w)    (((w) - DSP_BASE_ADDR) * 2)

Definition at line 152 of file msnd.h.

#define F_AUDIO_READ_INUSE   6

Definition at line 222 of file msnd.h.

#define F_AUDIO_WRITE_INUSE   2

Definition at line 218 of file msnd.h.

#define F_DISABLE_WRITE_NDELAY   11

Definition at line 227 of file msnd.h.

#define F_EXT_MIDI_INUSE   9

Definition at line 225 of file msnd.h.

#define F_HAVEDIGITAL   1

Definition at line 217 of file msnd.h.

#define F_HDR_MIDI_INUSE   10

Definition at line 226 of file msnd.h.

#define F_READBLOCK   8

Definition at line 224 of file msnd.h.

#define F_READING   7

Definition at line 223 of file msnd.h.

#define F_RESETTING   0

Definition at line 216 of file msnd.h.

#define F_WRITEBLOCK   4

Definition at line 220 of file msnd.h.

#define F_WRITEFLUSH   5

Definition at line 221 of file msnd.h.

#define F_WRITING   3

Definition at line 219 of file msnd.h.

#define HDEX_AUX_REQ   (10 + HDEX_BASE)

Definition at line 141 of file msnd.h.

#define HDEX_BASE   0x92

Definition at line 130 of file msnd.h.

#define HDEX_MIDI_IN_START   (6 + HDEX_BASE)

Definition at line 137 of file msnd.h.

#define HDEX_MIDI_IN_STOP   (7 + HDEX_BASE)

Definition at line 138 of file msnd.h.

#define HDEX_MIDI_OUT_START   (8 + HDEX_BASE)

Definition at line 139 of file msnd.h.

#define HDEX_MIDI_OUT_STOP   (9 + HDEX_BASE)

Definition at line 140 of file msnd.h.

#define HDEX_PLAY_PAUSE   (2 + HDEX_BASE)

Definition at line 133 of file msnd.h.

#define HDEX_PLAY_RESUME   (3 + HDEX_BASE)

Definition at line 134 of file msnd.h.

#define HDEX_PLAY_START   (0 + HDEX_BASE)

Definition at line 131 of file msnd.h.

#define HDEX_PLAY_STOP   (1 + HDEX_BASE)

Definition at line 132 of file msnd.h.

#define HDEX_RECORD_START   (4 + HDEX_BASE)

Definition at line 135 of file msnd.h.

#define HDEX_RECORD_STOP   (5 + HDEX_BASE)

Definition at line 136 of file msnd.h.

#define HIBYTE (   w)    ((BYTE)(((WORD)(w) >> 8) & 0xFF))

Definition at line 145 of file msnd.h.

#define HIMT_DSP   0x0F

Definition at line 128 of file msnd.h.

#define HIMT_MIDI_EOS   0x02

Definition at line 124 of file msnd.h.

#define HIMT_MIDI_IN_UCHAR   0x0E

Definition at line 127 of file msnd.h.

#define HIMT_MIDI_OUT   0x03

Definition at line 125 of file msnd.h.

#define HIMT_PLAY_DONE   0x00

Definition at line 122 of file msnd.h.

#define HIMT_RECORD_DONE   0x01

Definition at line 123 of file msnd.h.

#define HIWORD (   l)    ((WORD)((((DWORD)(l)) >> 16) & 0xFFFF))

Definition at line 143 of file msnd.h.

#define HP_CVR   0x01

Definition at line 48 of file msnd.h.

#define HP_CVR_DEF   0x12

Definition at line 61 of file msnd.h.

#define HP_ICR   0x00

Definition at line 47 of file msnd.h.

#define HP_ICR_DEF   0x00

Definition at line 60 of file msnd.h.

#define HP_INFO   0x04

Definition at line 52 of file msnd.h.

#define HP_IRQM   0x09

Definition at line 66 of file msnd.h.

#define HP_ISR   0x02

Definition at line 49 of file msnd.h.

#define HP_ISR_DEF   0x06

Definition at line 62 of file msnd.h.

#define HP_IVR   0x03

Definition at line 50 of file msnd.h.

#define HP_IVR_DEF   0x0f

Definition at line 63 of file msnd.h.

#define HP_NU   0x04

Definition at line 51 of file msnd.h.

#define HP_NU_DEF   0x00

Definition at line 64 of file msnd.h.

#define HP_RXH   0x05

Definition at line 54 of file msnd.h.

#define HP_RXL   0x07

Definition at line 58 of file msnd.h.

#define HP_RXM   0x06

Definition at line 56 of file msnd.h.

#define HP_TXH   0x05

Definition at line 53 of file msnd.h.

#define HP_TXL   0x07

Definition at line 57 of file msnd.h.

#define HP_TXM   0x06

Definition at line 55 of file msnd.h.

#define HPCVR_HC   0x80

Definition at line 85 of file msnd.h.

#define HPICR_HF0   0x08

Definition at line 81 of file msnd.h.

#define HPICR_HF1   0x10

Definition at line 80 of file msnd.h.

#define HPICR_HM0   0x20

Definition at line 79 of file msnd.h.

#define HPICR_HM1   0x40

Definition at line 78 of file msnd.h.

#define HPICR_INIT   0x80

Definition at line 77 of file msnd.h.

#define HPICR_RREQ   0x01

Definition at line 83 of file msnd.h.

#define HPICR_TREQ   0x02

Definition at line 82 of file msnd.h.

#define HPIO_210   6

Definition at line 101 of file msnd.h.

#define HPIO_220   5

Definition at line 100 of file msnd.h.

#define HPIO_230   4

Definition at line 99 of file msnd.h.

#define HPIO_240   3

Definition at line 98 of file msnd.h.

#define HPIO_250   2

Definition at line 97 of file msnd.h.

#define HPIO_260   1

Definition at line 96 of file msnd.h.

#define HPIO_290   0

Definition at line 95 of file msnd.h.

#define HPIO_3E0   7

Definition at line 102 of file msnd.h.

#define HPIRQ_10   4

Definition at line 117 of file msnd.h.

#define HPIRQ_11   5

Definition at line 118 of file msnd.h.

#define HPIRQ_12   6

Definition at line 119 of file msnd.h.

#define HPIRQ_15   7

Definition at line 120 of file msnd.h.

#define HPIRQ_5   1

Definition at line 114 of file msnd.h.

#define HPIRQ_7   2

Definition at line 115 of file msnd.h.

#define HPIRQ_9   3

Definition at line 116 of file msnd.h.

#define HPIRQ_NONE   0

Definition at line 113 of file msnd.h.

#define HPISR_DMA   0x40

Definition at line 88 of file msnd.h.

#define HPISR_HF2   0x08

Definition at line 90 of file msnd.h.

#define HPISR_HF3   0x10

Definition at line 89 of file msnd.h.

#define HPISR_HREQ   0x80

Definition at line 87 of file msnd.h.

#define HPISR_RXDF   0x01

Definition at line 93 of file msnd.h.

#define HPISR_TRDY   0x04

Definition at line 91 of file msnd.h.

#define HPISR_TXDE   0x02

Definition at line 92 of file msnd.h.

#define HPMEM_B000   1

Definition at line 105 of file msnd.h.

#define HPMEM_C800   2

Definition at line 106 of file msnd.h.

#define HPMEM_D000   3

Definition at line 107 of file msnd.h.

#define HPMEM_D400   4

Definition at line 108 of file msnd.h.

#define HPMEM_D800   5

Definition at line 109 of file msnd.h.

#define HPMEM_E000   6

Definition at line 110 of file msnd.h.

#define HPMEM_E800   7

Definition at line 111 of file msnd.h.

#define HPMEM_NONE   0

Definition at line 104 of file msnd.h.

#define HPR_BLRC   0x08

Definition at line 68 of file msnd.h.

#define HPR_SPR1   0x09

Definition at line 69 of file msnd.h.

#define HPR_SPR2   0x0A

Definition at line 70 of file msnd.h.

#define HPR_TCL0   0x0B

Definition at line 71 of file msnd.h.

#define HPR_TCL1   0x0C

Definition at line 72 of file msnd.h.

#define HPR_TCL2   0x0D

Definition at line 73 of file msnd.h.

#define HPR_TCL3   0x0E

Definition at line 74 of file msnd.h.

#define HPR_TCL4   0x0F

Definition at line 75 of file msnd.h.

#define JQS__size   0x08

Definition at line 167 of file msnd.h.

#define JQS_wHead   0x04

Definition at line 165 of file msnd.h.

#define JQS_wSize   0x02

Definition at line 164 of file msnd.h.

#define JQS_wStart   0x00

Definition at line 163 of file msnd.h.

#define JQS_wTail   0x06

Definition at line 166 of file msnd.h.

#define LOBYTE (   w)    ((BYTE)(w))

Definition at line 146 of file msnd.h.

#define LOWORD (   l)    ((WORD)(DWORD)(l))

Definition at line 144 of file msnd.h.

#define MAKELONG (   low,
  hi 
)    ((long)(((WORD)(low))|(((DWORD)((WORD)(hi)))<<16)))

Definition at line 147 of file msnd.h.

#define MAKEWORD (   low,
  hi 
)    ((WORD)(((BYTE)(low))|(((WORD)((BYTE)(hi)))<<8)))

Definition at line 148 of file msnd.h.

#define mdelay (   a)    udelay((a) * 1000)

Definition at line 254 of file msnd.h.

#define msnd_inb   inb

Definition at line 159 of file msnd.h.

#define msnd_outb   outb

Definition at line 158 of file msnd.h.

#define PCTODSP_BASED (   w)    (USHORT)(((w)/2) + DSP_BASE_ADDR)

Definition at line 151 of file msnd.h.

#define PCTODSP_OFFSET (   w)    (USHORT)((w)/2)

Definition at line 150 of file msnd.h.

#define SNDCARD_MSND   38

Definition at line 39 of file msnd.h.

#define SRAM_BANK_SIZE   0x8000

Definition at line 41 of file msnd.h.

#define SRAM_CNTL_START   0x7F00

Definition at line 42 of file msnd.h.

#define VERSION   "0.8.3.1"

Definition at line 31 of file msnd.h.

Typedef Documentation

typedef u8 BYTE

Definition at line 180 of file msnd.h.

typedef u32 DWORD

Definition at line 183 of file msnd.h.

typedef void __iomem* LPDAQD

Definition at line 184 of file msnd.h.

typedef u16 USHORT

Definition at line 181 of file msnd.h.

typedef u16 WORD

Definition at line 182 of file msnd.h.

Function Documentation

int msnd_disable_irq ( multisound_dev_t dev)

Definition at line 348 of file msnd.c.

int msnd_enable_irq ( multisound_dev_t dev)

Definition at line 320 of file msnd.c.

int msnd_fifo_alloc ( msnd_fifo f,
size_t  n 
)

Definition at line 99 of file msnd.c.

void msnd_fifo_free ( msnd_fifo f)

Definition at line 93 of file msnd.c.

void msnd_fifo_init ( msnd_fifo f)

Definition at line 88 of file msnd.c.

void msnd_fifo_make_empty ( msnd_fifo f)

Definition at line 114 of file msnd.c.

int msnd_fifo_read ( msnd_fifo f,
char buf,
size_t  len 
)

Definition at line 212 of file msnd.c.

int msnd_fifo_read_io ( msnd_fifo f,
char __iomem buf,
size_t  len 
)

Definition at line 181 of file msnd.c.

int msnd_fifo_write ( msnd_fifo f,
const char buf,
size_t  len 
)

Definition at line 150 of file msnd.c.

int msnd_fifo_write_io ( msnd_fifo f,
char __iomem buf,
size_t  len 
)

Definition at line 119 of file msnd.c.

void msnd_init_queue ( void __iomem ,
int  start,
int  size 
)

Definition at line 80 of file msnd.c.

int msnd_register ( multisound_dev_t dev)

Definition at line 47 of file msnd.c.

int msnd_send_dsp_cmd ( multisound_dev_t dev,
BYTE  cmd 
)

Definition at line 267 of file msnd.c.

int msnd_send_word ( multisound_dev_t dev,
unsigned char  high,
unsigned char  mid,
unsigned char  low 
)

Definition at line 284 of file msnd.c.

void msnd_unregister ( multisound_dev_t dev)

Definition at line 63 of file msnd.c.

int msnd_upload_host ( multisound_dev_t dev,
char bin,
int  len 
)

Definition at line 301 of file msnd.c.