summaryrefslogtreecommitdiffstats
path: root/model.c
blob: 765a88522f9d4cc3dbedf8872fe121053cac3d49 (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
#define _PCIDEV_MODEL_C

#include <stdio.h>
#include <strings.h>

#include <pcilib.h>
#include <pcilib/model.h>

#include "version.h"

#include "registers.h"
#include "dma.h"
#include "events.h"
#include "model.h"

static const pcilib_model_description_t pcidev_models[] = {{
    PCILIB_EVENT_INTERFACE_VERSION,
    &pcidev_event_api,
    &pcidev_dma,
    NULL, // Registers are defined in XML
    NULL, // Banks are defined in XML
    &pcidev_protocols,
    NULL, // Register ranges are defined in XML
    NULL,
    NULL,
    pcidev_events,
    pcidev_data_types,
    "pcidev",
    "Sample Plugin"
}, { 0 }};


const pcilib_model_description_t *pcilib_get_event_model(pcilib_t *pcilib, unsigned short vendor_id, unsigned short device_id, const char *model) {
	// Enumeration call
    if ((!vendor_id)&&(!device_id)&&(!model)) {
	return pcidev_models;
    }

    if ((model)&&(strcasecmp(model, "pcidev")))
	return NULL;

    return &pcidev_models[0];
}