File: fmc-sdb.h

package info (click to toggle)
linux-tools 3.16-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 73,776 kB
  • sloc: ansic: 962,256; perl: 14,061; makefile: 6,629; sh: 5,629; cpp: 5,599; python: 4,547; asm: 4,106; yacc: 2,566; lex: 1,436; pascal: 80; awk: 6
file content (38 lines) | stat: -rw-r--r-- 1,280 bytes parent folder | download | duplicates (20)
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
/*
 * This file is separate from sdb.h, because I want that one to remain
 * unchanged (as far as possible) from the official sdb distribution
 *
 * This file and associated functionality are a playground for me to
 * understand stuff which will later be implemented in more generic places.
 */
#include <linux/sdb.h>

/* This is the union of all currently defined types */
union sdb_record {
	struct sdb_interconnect ic;
	struct sdb_device dev;
	struct sdb_bridge bridge;
	struct sdb_integration integr;
	struct sdb_empty empty;
	struct sdb_synthesis synthesis;
	struct sdb_repo_url repo_url;
};

struct fmc_device;

/* Every sdb table is turned into this structure */
struct sdb_array {
	int len;
	int level;
	unsigned long baseaddr;
	struct fmc_device *fmc;		/* the device that hosts it */
	struct sdb_array *parent;	/* NULL at root */
	union sdb_record *record;	/* copies of the struct */
	struct sdb_array **subtree;	/* only valid for bridge items */
};

extern int fmc_scan_sdb_tree(struct fmc_device *fmc, unsigned long address);
extern void fmc_show_sdb_tree(const struct fmc_device *fmc);
extern signed long fmc_find_sdb_device(struct sdb_array *tree, uint64_t vendor,
				       uint32_t device, unsigned long *sz);
extern int fmc_free_sdb_tree(struct fmc_device *fmc);