root/trunk/libffado/src/bounce/bounce_slave_avdevice.h

Revision 864, 2.9 kB (checked in by ppalmers, 15 years ago)

update license to GPLv2 or GPLv3 instead of GPLv2 or any later version. Update copyrights to reflect the new year

Line 
1 /*
2  * Copyright (C) 2005-2008 by Pieter Palmers
3  * Copyright (C) 2005-2008 by Daniel Wagner
4  *
5  * This file is part of FFADO
6  * FFADO = Free Firewire (pro-)audio drivers for linux
7  *
8  * FFADO is based upon FreeBoB
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 2 of the License, or
13  * (at your option) version 3 of the License.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
22  *
23  */
24
25 #ifndef __FFADO_BOUNCESLAVEDEVICE__
26 #define __FFADO_BOUNCESLAVEDEVICE__
27
28 #include "debugmodule/debugmodule.h"
29 #include "bounce_avdevice.h"
30
31 #define FFADO_MAX_NAME_LEN 256
32
33 #define FFADO_BOUNCE_SERVER_VENDORNAME  "FFADO Server"
34 #define FFADO_BOUNCE_SERVER_MODELNAME   "ffado-server"
35
36 // NOTE: this is currently free, but it is not really allowed to use
37 #define FFADO_BOUNCE_SERVER_VENDORID    0x000B0001
38 #define FFADO_BOUNCE_SERVER_MODELID     0x000B0001
39 #define FFADO_BOUNCE_SERVER_SPECID      0x000B0001
40
41 namespace Bounce {
42
43 class BounceSlaveDevice : public BounceDevice {
44     class BounceSlaveNotifier;
45 public:
46
47     BounceSlaveDevice( Ieee1394Service& ieee1394Service,
48                        std::auto_ptr<ConfigRom>( configRom ));
49     virtual ~BounceSlaveDevice();
50
51     static bool probe( ConfigRom& configRom );
52     static FFADODevice * createDevice( Ieee1394Service& ieee1394Service,
53                                         std::auto_ptr<ConfigRom>( configRom ));
54     bool discover();
55     bool prepare();
56     bool lock();
57     bool unlock();
58
59     bool startStreamByIndex(int i);
60     bool stopStreamByIndex(int i);
61
62 private:
63     bool waitForRegisterNotEqualTo(nodeaddr_t offset, fb_quadlet_t v);
64     bool initMemSpace();
65     bool restoreMemSpace();
66
67 private: // configrom shit
68
69     struct configrom_backup {
70         quadlet_t rom[0x100];
71         size_t rom_size;
72         unsigned char rom_version;
73     };
74     struct configrom_backup m_original_config_rom;
75
76     struct configrom_backup
77         save_config_rom(raw1394handle_t handle);
78     int restore_config_rom(raw1394handle_t handle, struct configrom_backup old);
79     int init_config_rom(raw1394handle_t handle);
80
81 private:
82     BounceSlaveNotifier *m_Notifier;
83     /**
84      * this class reacts on the ohter side writing to the
85      * hosts address space
86      */
87     class BounceSlaveNotifier : public ARMHandler
88     {
89     public:
90         BounceSlaveNotifier(BounceSlaveDevice *, nodeaddr_t start);
91         virtual ~BounceSlaveNotifier();
92
93     private:
94         BounceSlaveDevice *m_bounceslavedevice;
95     };
96 };
97
98 } // end of namespace Bounce
99
100 #endif /* __FFADO_BOUNCESLAVEDEVICE__ */
101
102
Note: See TracBrowser for help on using the browser.