summaryrefslogtreecommitdiff
path: root/arch/arm/plat-omap/include/syslink/nameserver.h
blob: 3aeee242bc3928d48d49b026aabfffd7825f05ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
/*
 *  nameserver.h
 *
 *  The nameserver module manages local name/value pairs that
 *  enables an application and other modules to store and retrieve
 *  values based on a name.
 *
 *  Copyright (C) 2008-2009 Texas Instruments, Inc.
 *
 *  This package is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License version 2 as
 *  published by the Free Software Foundation.
 *
 *  THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 *  IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 *  WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
 *  PURPOSE.
 */

#ifndef _NAMESERVER_H_
#define _NAMESERVER_H_

#include <linux/types.h>
#include <linux/list.h>

/*
 *  NAMESERVER_MODULEID
 *  Unique module ID
 */
#define NAMESERVER_MODULEID      (0xF414)

struct nameserver_config {
	u32 reserved;
};

/*
 *  Instance config-params object.
 */
struct nameserver_params {
	u32 max_runtime_entries;
	void *table_heap; /* Table is placed into a section on dyn creates */
	bool check_existing; /* Prevents duplicate entry add in to the table */
	u32 max_value_len; /* Length, in MAUs, of the value field */
	u16 max_name_len; /* Length, in MAUs, of name field */
};


/*
 *  Function to get the default configuration for the nameserver module
 */
void nameserver_get_config(struct nameserver_config *cfg);

/*
 *  Function to setup the nameserver module
 */
int nameserver_setup(void);

/*
 *  Function to destroy the nameserver module
 */
int nameserver_destroy(void);

/*
 *  Function to construct a name server.
 */
void nameserver_construct(void *object, const char *name,
				const struct nameserver_params *params);

/*
 *  Function to destruct a name server
 */
void nameserver_destruct(void *object);

/*
 *  Function to register a remote driver
 */
int nameserver_register_remote_driver(void *handle, u16 proc_id);

/*
 *  Function to unregister a remote driver
 */
int nameserver_unregister_remote_driver(u16 proc_id);

/*
 *  Determines if a remote driver is registered for the specified id.
 */
bool nameserver_is_registered(u16 proc_id);

/*
 *  Function to initialize the parameter structure
 */
void nameserver_params_init(struct nameserver_params *params);

/*
 *  Function to create a name server
 */
void *nameserver_create(const char *name,
			const struct nameserver_params *params);

/*
 *  Function to delete a name server
 */
int nameserver_delete(void **handle);

/*
 *  Function to handle for  a name
 */
void *nameserver_get_handle(const char *name);

/*
 *  Function to add a variable length value into the local table
 */
void *nameserver_add(void *handle, const char *name, void *buf, u32 len);

/*
 *  Function to add a 32 bit value into the local table
 */
void *nameserver_add_uint32(void *handle, const char *name, u32 value);

/*
 *  Function to retrieve the value portion of a name/value pair
 */
int nameserver_get(void *handle, const char *name, void *buf, u32 *len,
			u16 procId[]);

/*
 *  Function to retrieve a 32-bit value of a name/value pair
 */
int nameserver_get_uint32(void *handle, const char *name, void *buf,
				u16 procId[]);

/*
 *  Function to get the value portion of a name/value pair from local table
 */
int nameserver_get_local(void *handle, const char *name, void *buf, u32 *len);

/*
 *  Function to retrieve a 32-bit value from the local name/value table
 */
int nameserver_get_local_uint32(void *handle, const char *name, void *buf);

/*
 *  Function to match the name
 */
int nameserver_match(void *handle, const char *name, u32 *value);

/*
 *  Function to removes a value/pair
 */
int nameserver_remove(void *handle, const char *name);

/*
 *  Function to remove an entry from the table
 */
int nameserver_remove_entry(void *handle, void *entry);

#endif /* _NAMESERVER_H_ */