nicer comment for DE entry
[platform/upstream/crda.git] / regdb.h
1 #include <linux/types.h>
2
3 /*
4  * WARNING: This file needs to be kept in sync with
5  *  - the parser (dbparse.py)
6  *  - the generator code (db2bin.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. We still consider this to be
15  * "Version 1" of the file.
16  */
17 #define REGDB_VERSION   19
18
19 /*
20  * The signature at the end of the file is an RSA-signed
21  * SHA-1 hash of the file.
22  */
23
24 struct regdb_file_header {
25         /* must be REGDB_MAGIC */
26         __be32  magic;
27         /* must be REGDB_VERSION */
28         __be32  version;
29         /*
30          * Pointer (offset) into file where country list starts
31          * and number of countries. The country list is sorted
32          * alphabetically to allow binary searching (should it
33          * become really huge.)
34          */
35         __be32  reg_country_ptr;
36         __be32  reg_country_num;
37         /* length (in bytes) of the signature at the end of the file */
38         __be32  signature_length;
39 };
40
41 struct regdb_file_reg_rule {
42         /* pointers (offsets) into the file */
43         __be32  freq_range_ptr;
44         __be32  power_rule_ptr;
45 };
46
47 struct regdb_file_freq_range {
48         __be32  start_freq,
49                 end_freq,
50                 max_bandwidth,
51                 modulation_cap,
52                 misc_restrictions;
53 };
54
55 struct regdb_file_power_rule {
56         __u8    environment_cap;
57         __u8    PAD[3];
58         /* antenna gain is in mBi (100 * dBi) */
59         __be32  max_antenna_gain;
60         /* these are in mBm (100 * dBm) */
61         __be32  max_ir_ptmp,
62                 max_ir_ptp,
63                 max_eirp_ptmp,
64                 max_eirp_ptp;
65 };
66
67 struct regdb_file_reg_rules_collection {
68         __be32  reg_rule_num;
69         /* pointers (offsets) into the file */
70         __be32  reg_rule_ptrs[];
71 };
72
73 struct regdb_file_reg_country {
74         __u8    alpha2[2];
75         __u8    PAD[2];
76         /* pointer (offset) into the file */
77         __be32  reg_collection_ptr;
78 };