Linux kernel & device driver programming

Cross-Referenced Linux and Device Driver Code

[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ]
Version: [ 2.6.11.8 ] [ 2.6.25 ] [ 2.6.25.8 ] [ 2.6.31.13 ] Architecture: [ i386 ]
  1 /*
  2  *   32bit -> 64bit ioctl wrapper for sequencer API
  3  *   Copyright (c) by Takashi Iwai <tiwai@suse.de>
  4  *
  5  *   This program is free software; you can redistribute it and/or modify
  6  *   it under the terms of the GNU General Public License as published by
  7  *   the Free Software Foundation; either version 2 of the License, or
  8  *   (at your option) any later version.
  9  *
 10  *   This program is distributed in the hope that it will be useful,
 11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 13  *   GNU General Public License for more details.
 14  *
 15  *   You should have received a copy of the GNU General Public License
 16  *   along with this program; if not, write to the Free Software
 17  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 18  *
 19  */
 20 
 21 #include <sound/driver.h>
 22 #include <linux/time.h>
 23 #include <linux/fs.h>
 24 #include <sound/core.h>
 25 #include <sound/timer.h>
 26 #include <asm/uaccess.h>
 27 #include <sound/asequencer.h>
 28 #include "ioctl32.h"
 29 
 30 struct sndrv_seq_port_info32 {
 31         struct sndrv_seq_addr addr;     /* client/port numbers */
 32         char name[64];                  /* port name */
 33 
 34         u32 capability; /* port capability bits */
 35         u32 type;               /* port type bits */
 36         s32 midi_channels;              /* channels per MIDI port */
 37         s32 midi_voices;                /* voices per MIDI port */
 38         s32 synth_voices;               /* voices per SYNTH port */
 39 
 40         s32 read_use;                   /* R/O: subscribers for output (from this port) */
 41         s32 write_use;                  /* R/O: subscribers for input (to this port) */
 42 
 43         u32 kernel;                     /* reserved for kernel use (must be NULL) */
 44         u32 flags;              /* misc. conditioning */
 45         unsigned char time_queue;       /* queue # for timestamping */
 46         char reserved[59];              /* for future use */
 47 };
 48 
 49 #define CVT_sndrv_seq_port_info()\
 50 {\
 51         COPY(addr);\
 52         COPY_ARRAY(name);\
 53         COPY(capability);\
 54         COPY(type);\
 55         COPY(midi_channels);\
 56         COPY(midi_voices);\
 57         COPY(synth_voices);\
 58         COPY(read_use);\
 59         COPY(write_use);\
 60         COPY(flags);\
 61         COPY(time_queue);\
 62 }
 63 
 64 DEFINE_ALSA_IOCTL(seq_port_info);
 65 DEFINE_ALSA_IOCTL_ENTRY(create_port, seq_port_info, SNDRV_SEQ_IOCTL_CREATE_PORT);
 66 DEFINE_ALSA_IOCTL_ENTRY(delete_port, seq_port_info, SNDRV_SEQ_IOCTL_DELETE_PORT);
 67 DEFINE_ALSA_IOCTL_ENTRY(get_port_info, seq_port_info, SNDRV_SEQ_IOCTL_GET_PORT_INFO);
 68 DEFINE_ALSA_IOCTL_ENTRY(set_port_info, seq_port_info, SNDRV_SEQ_IOCTL_SET_PORT_INFO);
 69 DEFINE_ALSA_IOCTL_ENTRY(query_next_port, seq_port_info, SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT);
 70 
 71 /*
 72  */
 73 #define AP(x) snd_ioctl32_##x
 74 
 75 enum {
 76   SNDRV_SEQ_IOCTL_CREATE_PORT32 = _IOWR('S', 0x20, struct sndrv_seq_port_info32),
 77   SNDRV_SEQ_IOCTL_DELETE_PORT32 = _IOW ('S', 0x21, struct sndrv_seq_port_info32),
 78   SNDRV_SEQ_IOCTL_GET_PORT_INFO32 = _IOWR('S', 0x22, struct sndrv_seq_port_info32),
 79   SNDRV_SEQ_IOCTL_SET_PORT_INFO32 = _IOW ('S', 0x23, struct sndrv_seq_port_info32),
 80   SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT32 = _IOWR('S', 0x52, struct sndrv_seq_port_info32),
 81 };
 82 
 83 struct ioctl32_mapper seq_mappers[] = {
 84         MAP_COMPAT(SNDRV_SEQ_IOCTL_PVERSION),
 85         MAP_COMPAT(SNDRV_SEQ_IOCTL_CLIENT_ID),
 86         MAP_COMPAT(SNDRV_SEQ_IOCTL_SYSTEM_INFO),
 87         MAP_COMPAT(SNDRV_SEQ_IOCTL_GET_CLIENT_INFO),
 88         MAP_COMPAT(SNDRV_SEQ_IOCTL_SET_CLIENT_INFO),
 89         { SNDRV_SEQ_IOCTL_CREATE_PORT32, AP(create_port) },
 90         { SNDRV_SEQ_IOCTL_DELETE_PORT32, AP(delete_port) },
 91         { SNDRV_SEQ_IOCTL_GET_PORT_INFO32, AP(get_port_info) },
 92         { SNDRV_SEQ_IOCTL_SET_PORT_INFO32, AP(set_port_info) },
 93         MAP_COMPAT(SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT),
 94         MAP_COMPAT(SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT),
 95         MAP_COMPAT(SNDRV_SEQ_IOCTL_CREATE_QUEUE),
 96         MAP_COMPAT(SNDRV_SEQ_IOCTL_DELETE_QUEUE),
 97         MAP_COMPAT(SNDRV_SEQ_IOCTL_GET_QUEUE_INFO),
 98         MAP_COMPAT(SNDRV_SEQ_IOCTL_SET_QUEUE_INFO),
 99         MAP_COMPAT(SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE),
100         MAP_COMPAT(SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS),
101         MAP_COMPAT(SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO),
102         MAP_COMPAT(SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO),
103         MAP_COMPAT(SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER),
104         MAP_COMPAT(SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER),
105         MAP_COMPAT(SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT),
106         MAP_COMPAT(SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT),
107         MAP_COMPAT(SNDRV_SEQ_IOCTL_GET_CLIENT_POOL),
108         MAP_COMPAT(SNDRV_SEQ_IOCTL_SET_CLIENT_POOL),
109         MAP_COMPAT(SNDRV_SEQ_IOCTL_REMOVE_EVENTS),
110         MAP_COMPAT(SNDRV_SEQ_IOCTL_QUERY_SUBS),
111         MAP_COMPAT(SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION),
112         MAP_COMPAT(SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT),
113         { SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT32, AP(query_next_port) },
114         MAP_COMPAT(SNDRV_SEQ_IOCTL_RUNNING_MODE),
115         { 0 },
116 };
117 
  This page was automatically generated by the LXR engine.