~ubuntu-branches/ubuntu/vivid/oss4/vivid-proposed

« back to all changes in this revision

Viewing changes to setup/Linux/oss/cuckoo/cuckoo.h

  • Committer: Bazaar Package Importer
  • Author(s): Romain Beauxis, Samuel Thibault, Romain Beauxis, Sebastien NOEL
  • Date: 2011-06-14 10:06:56 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110614100656-cx4oc7u426zn812z
Tags: 4.2-build2004-1
[ Samuel Thibault ]
* debian/control: Add liboss4-salsa2, liboss4-salsa-dev and
  liboss4-salsa-asound2 packages, equivalent to (and will replace) those from
  the oss-libsalsa package (Closes: #589127).
* debian/patches/liboss4-salsa.patch: New patch to rename libsalsa into
  liboss4-salsa to avoid conflicts in the archive for no good reason.
* debian/rules: Make in libOSSlib and libsalsa.
* debian/liboss4-salsa-dev.install, debian/liboss4-salsa2.install,
  debian/liboss4-salsa-asound2.links, debian/liboss4-salsa-dev.links:
  Install liboss4-salsa libraries like was done in the oss-libsalsa package.
* include-alsa: Add a copy of ALSA 1.0.5 headers: Cf ALSA_1.0.* symbols in
  libsalsa, this is the roughly supported version.
* debian/copyright: Update for new include-alsa files.
* alsa.pc: New file for compatibility with libasound-dev.
* debian/control:
  - Add Vcs-Browser and Vcs-Svn fields.
  - Use linux-any instead of the list of Linux archs (Closes: #604679).
  - Make dkms dependency linux-any only.
* debian/patches/hurd_iot.patch: New patch to fix soundcard.h usage in
  libsalsa on hurd-i386.
* debian/patches/libsalsa_fixes.patch: New patch to fix some printf usages
  and ioctl declaration in libsalsa.
* debian/patches/no_EBADE.patch: New patch to cope with hurd-i386 not having
  EBADE.
* debian/patches/CFLAGS.patch: New patch to make oss4 take debian/rules
  CFLAGS into account.
* debian/patches/snd_asoundlib_version.patch: New patch to add
  snd_asoundlib_version().
* debian/patches/generic_srccconf.patch: New patch to fix source
  configuration on unknown archs.

[ Romain Beauxis ]
* Fixed README.Debian to only mention dkms' modules.
* Switch to dpkg-source 3.0 (quilt) format
* Added DM-Upload-Allowed: yes

[ Sebastien NOEL ]
* New upstream release (Closes: #595298, #619272).
* Fix typo in initscript (Closes: #627149).
* debian/control: adjust linux-headers dependencies (Closes: #628879).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This software module makes it possible to use Open Ssund System for Linux
 
3
 * (the _professional_ version) as a low level driver source for ALSA.
 
4
 *
 
5
 * Copyright (C) 2004-2006 Hannu Savolainen (hannu@voimakentta.net).
 
6
 *
 
7
 * This library is free software; you can redistribute it and/or
 
8
 * modify it under the terms of the GNU Lesser General Public
 
9
 * License as published by the Free Software Foundation; either
 
10
 * version 2.1 of the License.
 
11
 *
 
12
 * This library is distributed in the hope that it will be useful,
 
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
15
 * Lesser General Public License for more details.
 
16
 */
 
17
 
 
18
#define _KERNEL
 
19
 
 
20
/*
 
21
 * !!!!!!!!!!!!!!!!!!!! Important  !!!!!!!!!!!!!!!!!!
 
22
 *
 
23
 * If this file doesn't compile, you must not try to resolve the problem
 
24
 * without perfect understanding of internals of Linux kernel, ALSA and
 
25
 * Open Sound System.
 
26
 *
 
27
 * Instead you need to check that you are using the version of this file
 
28
 * that matches the versions of ALSA, OSS and Linux you are currently using.
 
29
 */
 
30
 
 
31
#define _KERNEL
 
32
#include "../include/sys/soundcard.h"
 
33
 
 
34
#include <linux/version.h>
 
35
 
 
36
#define _LOOSE_KERNEL_NAMES
 
37
 
 
38
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18)
 
39
#include <linux/config.h>
 
40
#else
 
41
#include <linux/autoconf.h>
 
42
#endif
 
43
 
 
44
#if !defined(__SMP__) && defined(CONFIG_SMP)
 
45
#define __SMP__
 
46
#endif
 
47
#include <linux/module.h>
 
48
 
 
49
#include <stdarg.h>
 
50
 
 
51
extern int oss_get_cardinfo (int cardnum, oss_card_info * ci);  /* from oss_config.h */
 
52
 
 
53
#include <linux/param.h>
 
54
#include <linux/types.h>
 
55
#include <linux/errno.h>
 
56
#include <linux/signal.h>
 
57
#include <linux/fcntl.h>
 
58
#include <linux/sched.h>
 
59
#include <linux/timer.h>
 
60
#include <linux/tty.h>
 
61
#include <linux/mm.h>
 
62
#include <linux/ctype.h>
 
63
#include <linux/delay.h>
 
64
#include <linux/vmalloc.h>
 
65
#include <asm/processor.h>
 
66
#include <asm/io.h>
 
67
#include <linux/pci.h>
 
68
#include <linux/apm_bios.h>
 
69
#include <asm/segment.h>
 
70
#include <asm/uaccess.h>
 
71
#include <linux/poll.h>
 
72
 
 
73
#include <asm/system.h>
 
74
#include <asm/dma.h>
 
75
#include <linux/wait.h>
 
76
#include <linux/slab.h>
 
77
#include <linux/string.h>
 
78
#include <linux/ioport.h>
 
79
//#include <asm/mach-default/irq_vectors.h>
 
80
#include <linux/interrupt.h>
 
81
#include <linux/pm.h>
 
82
 
 
83
struct _oss_mutex_t
 
84
{
 
85
  /* Caution! This definition must match Linux/osscore.c */
 
86
  spinlock_t lock;
 
87
};
 
88
 
 
89
#define audio_devs dummy_audio_devs
 
90
 
 
91
#include "../include/internals/oss_exports.h"
 
92
#include "../build/wrap.h"
 
93
#include "../include/internals/ossddk.h"
 
94
 
 
95
typedef struct oss_wait_queue oss_wait_queue_t; /* This must match oss_config.h */
 
96
 
 
97
#include "../include/internals/ossddk.h"
 
98
 
 
99
//#include <sound/driver.h>
 
100
#include <sound/core.h>
 
101
#include <sound/control.h>
 
102
#include <sound/pcm.h>
 
103
 
 
104
#include "../build/osscore_symbols.inc"
 
105
 
 
106
#define SNDRV_GET_ID
 
107
#include <sound/initval.h>
 
108
 
 
109
typedef caddr_t ioctl_arg;
 
110
typedef char snd_rw_buf;
 
111
 
 
112
typedef int sound_os_info;
 
113
 
 
114
#define WR_BUF_CONST    const
 
115
 
 
116
#include "../include/internals/audio_core.h"
 
117
#include "../include/internals/mixer_core.h"
 
118
 
 
119
typedef struct _snd_cuckoo cuckoo_t, chip_t;
 
120
 
 
121
typedef struct
 
122
{
 
123
  adev_p adev;
 
124
} cuckoo_pcm_t;
 
125
 
 
126
#define MAX_OSSPCM 24           // Max # of PCM devices/card instance
 
127
 
 
128
#if 1
 
129
// Older ALSA versions used to define these...
 
130
typedef struct snd_card snd_card_t;
 
131
typedef struct snd_pcm snd_pcm_t;
 
132
typedef struct snd_rawmidi snd_rawmidi_t;
 
133
typedef struct snd_rawmidi_substream snd_rawmidi_substream_t;
 
134
typedef struct snd_rawmidi_ops snd_rawmidi_ops_t;
 
135
typedef struct snd_kcontrol snd_kcontrol_t;
 
136
typedef struct snd_kcontrol_new snd_kcontrol_new_t;
 
137
typedef struct snd_ctl_elem_info snd_ctl_elem_info_t;
 
138
typedef struct snd_ctl_elem_value snd_ctl_elem_value_t;
 
139
typedef struct snd_pcm_substream snd_pcm_substream_t;
 
140
typedef struct snd_pcm_hardware snd_pcm_hardware_t;
 
141
typedef struct snd_pcm_runtime snd_pcm_runtime_t;
 
142
typedef struct snd_pcm_hw_params snd_pcm_hw_params_t;
 
143
typedef struct snd_pcm_ops snd_pcm_ops_t;
 
144
typedef struct snd_device snd_device_t;
 
145
typedef struct snd_device_ops snd_device_ops_t;
 
146
#endif
 
147
 
 
148
struct _snd_cuckoo
 
149
{
 
150
  snd_card_t *card;
 
151
  snd_pcm_t *pcm[MAX_OSSPCM];
 
152
  adev_p play_adev[MAX_OSSPCM], capture_adev[MAX_OSSPCM];
 
153
  int osscard;
 
154
  int nplay, ncapture, npcm;
 
155
};
 
156
 
 
157
#define cuckoo_t_magic 0xaabbccdd
 
158
#define chip__tmagic cuckoo_t_magic
 
159
 
 
160
//#define OPEN_READ     PCM_ENABLE_INPUT
 
161
//#define OPEN_WRITE    PCM_ENABLE_OUTPUT
 
162
 
 
163
extern int install_mixer_instances (cuckoo_t * chip, int cardno);
 
164
extern int install_midiport_instances (cuckoo_t * chip, int cardno);
 
165
extern int install_pcm_instances (cuckoo_t * chip, int cardno);
 
166
 
 
167
// Disable locking for now
 
168
#define udi_spin_lock_irqsave(a, b) *(b)=0
 
169
#define udi_spin_unlock_irqrestore(a, b)
 
170
 
 
171
#define strlcpy(a, b) {strncpy(a, b, sizeof(a)-1);a[sizeof(a)-1]=0;}