patch-2.1.88 linux/drivers/sound/sound_config.h

Next file: linux/drivers/sound/sound_timer.c
Previous file: linux/drivers/sound/sound_calls.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.87/linux/drivers/sound/sound_config.h linux/drivers/sound/sound_config.h
@@ -10,7 +10,7 @@
  * for more info.
  */
 
-
+#include <linux/fs.h>
 #include "local.h.master"
 #include <linux/config.h>
 #include "os.h"
@@ -18,9 +18,6 @@
 
 
 
-
-
-
 #ifndef SND_DEFAULT_ENABLE
 #define SND_DEFAULT_ENABLE	1
 #endif
@@ -91,21 +88,12 @@
 
 #define DSP_DEFAULT_SPEED	8000
 
-#define ON		1
-#define OFF		0
-
 #define MAX_AUDIO_DEV	5
 #define MAX_MIXER_DEV	5
 #define MAX_SYNTH_DEV	5
 #define MAX_MIDI_DEV	6
 #define MAX_TIMER_DEV	4
 
-struct fileinfo {
-       	  int mode;	      /* Open mode */
-	  int flags;
-	  int dummy;     /* Reference to file-flags. OS-dependent. */
-       };
-
 struct address_info {
 	int io_base;
 	int irq;
@@ -154,6 +142,24 @@
 #define OPEN_WRITE	PCM_ENABLE_OUTPUT
 #define OPEN_READWRITE	(OPEN_READ|OPEN_WRITE)
 
+#if OPEN_READ == FMODE_READ && OPEN_WRITE == FMODE_WRITE
+
+extern __inline__ int translate_mode(struct file *file)
+{
+	return file->f_mode;
+}
+
+#else
+
+extern __inline__ int translate_mode(struct file *file)
+{
+	return ((file->f_mode & FMODE_READ) ? OPEN_READ : 0) |
+		((file->f_mode & FMODE_WRITE) ? OPEN_WRITE : 0);
+}
+
+#endif
+
+
 #include "sound_calls.h"
 #include "dev_table.h"
 
@@ -175,7 +181,3 @@
 
 #define TIMER_ARMED	121234
 #define TIMER_NOT_ARMED	1
-
-
-
-

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov