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