1
2
3
4
5
6
7
8
9 #ifndef __NFP_H__
10 #define __NFP_H__
11
12 #include <linux/device.h>
13 #include <linux/types.h>
14
15 #include "nfp_cpp.h"
16
17
18
19 struct nfp_hwinfo;
20 struct nfp_hwinfo *nfp_hwinfo_read(struct nfp_cpp *cpp);
21 const char *nfp_hwinfo_lookup(struct nfp_hwinfo *hwinfo, const char *lookup);
22 char *nfp_hwinfo_get_packed_strings(struct nfp_hwinfo *hwinfo);
23 u32 nfp_hwinfo_get_packed_str_size(struct nfp_hwinfo *hwinfo);
24
25
26
27 struct nfp_nsp;
28
29 struct nfp_cpp *nfp_nsp_cpp(struct nfp_nsp *state);
30 bool nfp_nsp_config_modified(struct nfp_nsp *state);
31 void nfp_nsp_config_set_modified(struct nfp_nsp *state, bool modified);
32 void *nfp_nsp_config_entries(struct nfp_nsp *state);
33 unsigned int nfp_nsp_config_idx(struct nfp_nsp *state);
34 void nfp_nsp_config_set_state(struct nfp_nsp *state, void *entries,
35 unsigned int idx);
36 void nfp_nsp_config_clear_state(struct nfp_nsp *state);
37 int nfp_nsp_read_eth_table(struct nfp_nsp *state, void *buf, unsigned int size);
38 int nfp_nsp_write_eth_table(struct nfp_nsp *state,
39 const void *buf, unsigned int size);
40 int nfp_nsp_read_identify(struct nfp_nsp *state, void *buf, unsigned int size);
41 int nfp_nsp_read_sensors(struct nfp_nsp *state, unsigned int sensor_mask,
42 void *buf, unsigned int size);
43
44
45
46
47
48
49 #define NFP_RESOURCE_VNIC_PCI_0 "vnic.p0"
50 #define NFP_RESOURCE_VNIC_PCI_1 "vnic.p1"
51 #define NFP_RESOURCE_VNIC_PCI_2 "vnic.p2"
52 #define NFP_RESOURCE_VNIC_PCI_3 "vnic.p3"
53
54
55 #define NFP_RESOURCE_NFP_HWINFO "nfp.info"
56
57
58 #define NFP_RESOURCE_NSP "nfp.sp"
59 #define NFP_RESOURCE_NSP_DIAG "arm.diag"
60
61
62 #define NFP_RESOURCE_NFP_NFFW "nfp.nffw"
63
64
65 #define NFP_RESOURCE_MAC_STATISTICS "mac.stat"
66
67 int nfp_resource_table_init(struct nfp_cpp *cpp);
68
69 struct nfp_resource *
70 nfp_resource_acquire(struct nfp_cpp *cpp, const char *name);
71
72 void nfp_resource_release(struct nfp_resource *res);
73
74 int nfp_resource_wait(struct nfp_cpp *cpp, const char *name, unsigned int secs);
75
76 u32 nfp_resource_cpp_id(struct nfp_resource *res);
77
78 const char *nfp_resource_name(struct nfp_resource *res);
79
80 u64 nfp_resource_address(struct nfp_resource *res);
81
82 u64 nfp_resource_size(struct nfp_resource *res);
83
84 #endif