add Makefile for sqlite
[platform/upstream/crda.git] / daemon / regdb.h
1 #include <linux/types.h>
2
3 /* spells "RGDB" */
4 #define REGDB_MAGIC     0x52474442
5
6 /*
7  * Only supported version now, start at arbitrary number
8  * to have some more magic :)
9  */
10 #define REGDB_VERSION   19
11
12 struct regdb_file_header {
13         /* must be REGDB_MAGIC */
14         __be32  magic;
15         /* must be REGDB_VERSION */
16         __be32  version;
17         /* pointer (offset) into file where country list starts */
18         __be32  reg_country_ptr;
19         __be32  reg_country_num;
20 };
21
22 struct regdb_file_reg_rule {
23         /* pointers (offsets) into the file */
24         __be32  freq_range_ptr;
25         __be32  power_rule_ptr;
26 };
27
28 struct regdb_file_freq_range {
29         __be32  start_freq,
30                 end_freq,
31                 max_bandwidth,
32                 modulation_cap,
33                 misc_restrictions;
34 };
35
36 struct regdb_file_power_rule {
37         __u8    environment_cap;
38         __u8    PAD[3];
39         __be32  max_antenna_gain,
40                 max_ir_ptmp,
41                 max_ir_ptp,
42                 max_eirp_pmtp,
43                 max_eirp_ptp;
44 };
45
46 struct regdb_file_reg_rules_collection {
47         __be32  reg_rule_num;
48         /* pointers (offsets) into the file */
49         __be32  reg_rule_ptrs[];
50 };
51
52 struct regdb_file_reg_country {
53         __u8    alpha2[2];
54         __u8    PAD[2];
55         /* pointer (offset) into the file */
56         __be32  reg_collection_ptr;
57 };