/alps/pcitool

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/pcitool

« back to all changes in this revision

Viewing changes to pcilib/plugin.h

  • Committer: Suren A. Chilingaryan
  • Date: 2016-03-02 04:47:04 UTC
  • Revision ID: csa@suren.me-20160302044704-wncsxtf6sx0r0tps
Documentation update

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
extern "C" {
6
6
#endif
7
7
 
 
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
 */
8
15
void *pcilib_plugin_load(const char *name);
 
16
 
 
17
/**
 
18
 * Cleans up the loaded plugin
 
19
 * @param[in] plug      - plugin loaded with pcilib_plugin_load()
 
20
 */
9
21
void pcilib_plugin_close(void *plug);
 
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
 */
10
29
void *pcilib_plugin_get_symbol(void *plug, const char *symbol);
11
 
const pcilib_model_description_t *pcilib_get_plugin_model(pcilib_t *pcilib, void *plug, unsigned short vendor_id, unsigned short device_id, const char *model);
12
 
const pcilib_model_description_t *pcilib_find_plugin_model(pcilib_t *pcilib, unsigned short vendor_id, unsigned short device_id, const char *model);
 
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);
13
62
 
14
63
#ifdef __cplusplus
15
64
}