aboutsummaryrefslogtreecommitdiff
path: root/lib/cap.h
blob: 4606737864552e0b19923ff2b0e031a858599c83 (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
#ifndef __CAP_H__
#define __CAP_H__

#include "muser.h"

struct caps;

/**
 * Initializes PCI capabilities.
 *
 * Returns <0 on error, 0 if no capabilities are to be added, and >0 if all
 * capabilities have been added.
 */
struct caps*
caps_create(lm_cap_t *caps, int nr_caps);

/*
 * Conditionally accesses the PCI capabilities. Returns:
 *  0: if no PCI capabilities are accessed,
 * >0: if a PCI capability was accessed, with the return value indicating the
       number of bytes accessed, and
 * <0: negative error code on error.
 */
ssize_t
cap_maybe_access(struct caps *caps, void *pvt, char *buf, size_t count,
                 loff_t offset, bool is_write);

#endif /* __CAP_H__ */

/* ex: set tabstop=4 shiftwidth=4 softtabstop=4 expandtab: */