root/trunk/libffado/src/rme/rme_shm.h

Revision 1629, 1.9 kB (checked in by jwoithe, 14 years ago)

RME: refine shared device configuration locking. Rename some data objects for clarity. Move frequency settings into the shared configuration object since ultimately these need to be accessible to all FFADO/RME processes. Other minor cleanups.

Line 
1 /*
2  * Copyright (C) 2009 by Jonathan Woithe
3  *
4  * This file is part of FFADO
5  * FFADO = Free Firewire (pro-)audio drivers for linux
6  *
7  * FFADO is based upon FreeBoB.
8  *
9  * This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 2 of the License, or
12  * (at your option) version 3 of the License.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
21  *
22  */
23
24 #ifndef _RME_SHM_H
25 #define _RME_SHM_H
26
27 #include <stdint.h>
28 #include <pthread.h>
29 #include "fireface_def.h"
30
31 /* Structure used within shared memory object */
32
33 typedef struct rme_shm_t {
34     signed int ref_count;
35     signed int settings_valid, tco_settings_valid;
36     FF_software_settings_t settings;
37     signed int tco_present;
38     FF_TCO_settings_t tco_settings;
39
40     signed int dds_freq;      // Optionally explicitly set hardware freq
41     signed int software_freq; // Sampling frequency in use by software
42
43     signed int is_streaming;
44
45     pthread_mutex_t lock;
46 } rme_shm_t;
47
48 /* Return values from rme_shm_open().  RSO = Rme Shared Object. */
49 #define RSO_ERR_MMAP      -3
50 #define RSO_ERR_SHM       -2
51 #define RSO_ERROR         -1
52 #define RSO_OPEN_CREATED   0
53 #define RSO_OPEN_ATTACHED  1
54
55 /* Return values from rme_shm_close() */
56 #define RSO_CLOSE          0
57 #define RSO_CLOSE_DELETE   1
58
59 /* Functions */
60
61 void rme_shm_lock(rme_shm_t *shm_data);
62 void rme_shm_unlock(rme_shm_t *shm_data);
63 signed int rme_shm_open(rme_shm_t **shm_data);
64 signed int rme_shm_close(rme_shm_t *shm_data);
65
66 #endif
Note: See TracBrowser for help on using the browser.