/alps/pcitool

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/pcitool
242 by Suren A. Chilingaryan
Initial support for event engines
1
#ifndef _PCILIB_PLUGIN_H
2
#define _PCILIB_PLUGIN_H
3
277 by Suren A. Chilingaryan
Keep C++ compilers happy
4
#ifdef __cplusplus
5
extern "C" {
6
#endif
7
361 by Suren A. Chilingaryan
Documentation update
8
/**
9
 * Loads the specified plugin
10
 * The plugin symbols are loaded localy and not available for symbol resolution, but should be requested
11
 * with pcilib_plugin_get_symbol() instead.
12
 * @param[in] name	- the plugin name (with extension, but without path)
13
 * @return		- dlopen'ed plugin or NULL in the case of error
14
 */
242 by Suren A. Chilingaryan
Initial support for event engines
15
void *pcilib_plugin_load(const char *name);
361 by Suren A. Chilingaryan
Documentation update
16
17
/**
18
 * Cleans up the loaded plugin
19
 * @param[in] plug	- plugin loaded with pcilib_plugin_load()
20
 */
242 by Suren A. Chilingaryan
Initial support for event engines
21
void pcilib_plugin_close(void *plug);
361 by Suren A. Chilingaryan
Documentation update
22
23
/**
24
 * Resolves the specified symbol in the plugin
25
 * @param[in] plug	- plugin loaded with pcilib_plugin_load()
26
 * @param[in] symbol	- name of the symbol 
27
 * @return		- pointer to the symbol or NULL if not found
28
 */
242 by Suren A. Chilingaryan
Initial support for event engines
29
void *pcilib_plugin_get_symbol(void *plug, const char *symbol);
361 by Suren A. Chilingaryan
Documentation update
30
31
/**
32
 * Verifies if plugin can handle the hardware and requests appropriate model description
33
 * @param[in,out] ctx 	- pcilib context
34
 * @param[in] plug	- plugin loaded with pcilib_plugin_load()
35
 * @param[in] vendor_id	- Vendor ID reported by hardware
36
 * @param[in] device_id	- Device ID reported by hardware
37
 * @param[in] model	- the requested pcilib model or NULL for autodetction
38
 * @return		- the appropriate model description or NULL if the plugin does not handle the installed hardware or requested model
39
 */
40
const pcilib_model_description_t *pcilib_get_plugin_model(pcilib_t *ctx, void *plug, unsigned short vendor_id, unsigned short device_id, const char *model);
41
42
/**
43
 * Finds the appropriate plugin and returns model description.
44
 *
45
 * The function sequentially loads plugins available in ::PCILIB_PLUGIN_DIR and
46
 * checks if they support the installed hardware and requested model. If hardware
47
 * is not supported, the plugin is immideately unloaded. On a first success 
48
 * the model description is returned to caller and no further plguins are loaded. 
49
 * If no suitable plugin is found, the NULL is returned. 
50
 *
51
 * If model is specified, first a plugin with the same name is loaded and check performed
52
 * if it can handle the installed hardware. If not, we iterate over all available
53
 * plugins as usual.
54
 *
55
 * @param[in,out] ctx 	- pcilib context
56
 * @param[in] vendor_id	- Vendor ID reported by hardware
57
 * @param[in] device_id	- Device ID reported by hardware
58
 * @param[in] model	- the requested pcilib model or NULL for autodetction
59
 * @return		- the appropriate model description or NULL if no plugin found able to handle the installed hardware or requested model
60
 */
61
const pcilib_model_description_t *pcilib_find_plugin_model(pcilib_t *ctx, unsigned short vendor_id, unsigned short device_id, const char *model);
242 by Suren A. Chilingaryan
Initial support for event engines
62
277 by Suren A. Chilingaryan
Keep C++ compilers happy
63
#ifdef __cplusplus
64
}
65
#endif
66
242 by Suren A. Chilingaryan
Initial support for event engines
67
#endif /* _PCILIB_PLUGIN_H */