new regdb file format
Hi,
I spent a bit of time thinking about a file format that would be more extensible, yet still be loadable into the kernel without having to parse it into new data structures in the kernel, i.e. be easy enough to read when needed.
My considerations
* must be extensible in some way
* should be relatively dense
*
johannes
Err. Let's try that again.
I spent a bit of time thinking about a file format that would be more extensible, yet still be loadable into the kernel without having to parse it into new data structures in the kernel, i.e. be easy enough to read when needed.
My considerations
* must be extensible in some way
* should be relatively dense/small to not use too much kernel memory
* should still be reasonably easy to parse/read
I came up with a file format that's similar to the existing regulatory.bin format, but with the following changes:
* put the DFS region into a reg rule collection
* put the frequency range and power rules directly into each reg rule (i.e. don't try to normalize them)
* have a length field in the collection and rule structures so that we can extend them with new fields
* use more compact pointers, i.e. u16 offsets, by aligning everything to 4 bytes and shifting the offsets by 2 bits, this allows for 256KiB database files which seems large enough
More documentation is here:
https://wireless.wiki.kernel.org/en/developers/todo-list/regdb-file
-format
I put together a small sample program to create such a file from db.txt
(https://p.sipsolutions.net/1c42079f2e658a82.txt) and one to print such a file (https://p.sipsolutions.net/8c180172adbe0ad3.txt)
Thoughts?
johannes
Quoted 5 lines · Johannes Berg
More documentation is here:
https://wireless.wiki.kernel.org/en/developers/todo-list/regdb-file
-format
FWIW, the file currently ends up being 3676 bytes with a new field for the CAC timeout already added (though without signature, of course, since I'm assuming that to be external with firmware load signing or whatever)
regulatory.bin is currently 4592 bytes.
johannes
Quoted 23 lines · Johannes Berg
Err. Let's try that again.
I spent a bit of time thinking about a file format that would be more extensible, yet still be loadable into the kernel without having to parse it into new data structures in the kernel, i.e. be easy enough to read when needed.
My considerations
* must be extensible in some way
* should be relatively dense/small to not use too much kernel memory
* should still be reasonably easy to parse/readI came up with a file format that's similar to the existing regulatory.bin format, but with the following changes:
* put the DFS region into a reg rule collection
* put the frequency range and power rules directly into each reg rule (i.e. don't try to normalize them)
* have a length field in the collection and rule structures so that we can extend them with new fields
* use more compact pointers, i.e. u16 offsets, by aligning everything to 4 bytes and shifting the offsets by 2 bits, this allows for 256KiB database files which seems large enough
Quoted 4 lines
More documentation is here:
https://wireless.wiki.kernel.org/en/developers/todo-list/regdb-file
-format
while at it - is there any way to indicate exclusion of some channels? e.g. channels 38/42 in US (the current rule is "(5170 - 5250 @ 40)", which doesn't seem to forbid them)
Eliad.
Quoted 5 lines · Eliad Peller
while at it - is there any way to indicate exclusion of some channels?
e.g. channels 38/42 in US (the current rule is "(5170 - 5250 @ 40)", which doesn't seem to forbid them)
Hm? Why would you want to do that, if you are allowed to use that band?
johannes
Quoted 10 lines · Johannes Berg
Quoted 5 lines · Eliad Peller
while at it - is there any way to indicate exclusion of some channels?
e.g. channels 38/42 in US (the current rule is "(5170 - 5250 @ 40)", which doesn't seem to forbid them)Hm? Why would you want to do that, if you are allowed to use that band?
The spec seems to indicate the allowed channel set for each operating class, and some channels are allowed only in some countries (tables E-1 vs. E-2 in 802.11-2012 Annex E).
Eliad.
Quoted 8 lines · Eliad Peller
Quoted 4 lines
Hm? Why would you want to do that, if you are allowed to use that band?
The spec seems to indicate the allowed channel set for each operating class, and some channels are allowed only in some countries (tables E-1 vs. E-2 in 802.11-2012 Annex E).
But that's a different problem in a way - the regulatory database only tries to encode the legal restrictions, not the spec restrictions.
johannes
Quoted 5 lines · Johannes Berg
Quoted 4 lines · Eliad Peller
Quoted 4 lines
Hm? Why would you want to do that, if you are allowed to use that band?
Quoted 8 lines
Quoted 4 lines
The spec seems to indicate the allowed channel set for each operating class, and some channels are allowed only in some countries (tables E-1 vs. E-2 in 802.11-2012 Annex E).
But that's a different problem in a way - the regulatory database only tries to encode the legal restrictions, not the spec restrictions.
that's a good point :)
thanks,
Eliad.