root/trunk/libffado/src/libieee1394/ARMHandler.h

Revision 742, 2.6 kB (checked in by ppalmers, 13 years ago)

- Remove some obsolete support files and dirs

- Clean up the license statements in the source files. Everything is

GPL version 3 now.

- Add license and copyright notices to scons scripts

- Clean up some other text files

Line 
1 /*
2  * Copyright (C) 2005-2007 by Pieter Palmers
3  * Copyright (C) 2005-2007 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 3 of the License, or
13  * (at your option) any later version.
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_ARMHANDLER__
26 #define __FFADO_ARMHANDLER__
27
28 #include "../debugmodule/debugmodule.h"
29
30 #include <libraw1394/raw1394.h>
31
32 #include "ieee1394service.h"
33
34 /**
35  * @brief Class to handle AddressRangeMappings
36  *
37  * This class is intended to help with implementing
38  * address range mapping, i.e. implementing handlers
39  * that react to reads/writes of certain addresses
40  * in 1394 memory space
41  *
42  * see the _arm_ functions in raw1394.h for more insight
43  *
44  */
45
46 class ARMHandler {
47 friend class Ieee1394Service;
48
49 public:
50
51     ARMHandler(nodeaddr_t start, size_t length,
52                unsigned int access_rights,
53                unsigned int notification_options,
54                unsigned int client_transactions
55               );
56
57     virtual ~ARMHandler();
58
59     bool handleRead(struct raw1394_arm_request  *);
60     bool handleWrite(struct raw1394_arm_request  *);
61     bool handleLock(struct raw1394_arm_request  *);
62
63     struct raw1394_arm_response *getResponse() {return &m_response;};
64
65     nodeaddr_t getStart() {return m_start;};
66     nodeaddr_t getLength() {return m_length;};
67     unsigned int getAccessRights() {return m_access_rights;};
68     unsigned int getNotificationOptions() {return m_notification_options;};
69     unsigned int getClientTransactions() {return m_client_transactions;};
70
71     byte_t *getBuffer() {return m_buffer;};
72
73 private:
74     nodeaddr_t m_start;
75     size_t m_length;
76     unsigned int m_access_rights;
77     unsigned int m_notification_options;
78     unsigned int m_client_transactions;
79
80     byte_t *m_buffer;
81
82     struct raw1394_arm_response m_response;
83
84     void printBufferBytes( unsigned int level, size_t length, byte_t* buffer ) const;
85     void printRequest(struct raw1394_arm_request *arm_req);
86
87 protected:
88
89
90     DECLARE_DEBUG_MODULE;
91
92 };
93
94 #endif /* __FFADO_ARMHANDLER__ */
95
96
Note: See TracBrowser for help on using the browser.