Skip to content

Instantly share code, notes, and snippets.

@lisovy
Last active October 8, 2023 23:32
Show Gist options
  • Star 27 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save lisovy/80dde5a792e774a706a9 to your computer and use it in GitHub Desktop.
Save lisovy/80dde5a792e774a706a9 to your computer and use it in GitHub Desktop.
Clone and compile the Linux kernel
==================================
# Use some extra directory for all the components needed
cd c2c/
# Clone the repository (this will take a *few minutes*)
c2c$ git clone https://github.com/CTU-IIG/802.11p-linux.git
c2c$ cd 802.11p-linux
# Checkout particular branch
c2c/802.11p-linux$ git checkout its-g5_v3
# Prepare the folder for compilation
c2c/802.11p-linux$ mkdir _build
# Use the appropriate defconfig
c2c/802.11p-linux$ make O=_build x86_64_defconfig
# Configure the kernel if necessary (enable MAC80211_OCB_DEBUG, CONFIG_MAC80211_STA_DEBUG etc.)
c2c/802.11p-linux$ cd _build
c2c/802.11p-linux/_build$ make menuconfig
# Run the compilation
c2c/802.11p-linux/_build$ make -j4
# Install the modules and the kernel
c2c/802.11p-linux/_build$ sudo make modules_install
c2c/802.11p-linux/_build$ sudo make install
iw -- wifi configuration tool
=============================
# Use some extra directory for all the components needed
cd c2c/
# Install libnl development files
c2c$ sudo apt-get install libnl-dev
# Clone the official iw repository
c2c$ git clone https://github.com/CTU-IIG/802.11p-iw.git
c2c$ cd 802.11p-iw
c2c/802.11p-iw$ git checkout its-g5_v3
# Build it
c2c/802.11p-iw$ make
# Install it
c2c/802.11p-iw$ sudo PREFIX=/ make install
# Test it
c2c/802.11p-iw$ /sbin/iw | grep -i ocb
dev <devname> ocb leave
dev <devname> ocb join <freq in MHz> <5MHZ|10MHZ> [fixed-freq]
wireless-regdb -- regulatory information
========================================
# Use some extra directory for all the components needed
cd c2c/
# Install some extra packages
c2c$ sudo apt-get install python-m2crypto
# Clone the repository
c2c$ git clone https://github.com/CTU-IIG/802.11p-wireless-regdb.git
c2c$ cd 802.11p-wireless-regdb
c2c/802.11p-wireless-regdb$ git checkout its-g5_v1
c2c/802.11p-wireless-regdb$ make
c2c/802.11p-wireless-regdb$ sudo PREFIX=/ make install
CRDA -- Central Regulatory Domain Agent
=======================================
# Use some extra directory for all the components needed
cd c2c/
# Install some extra packages
c2c$ sudo apt-get install python-m2crypto
c2c$ sudo apt-get install libgcrypt11-dev
# Clone the repository
c2c$ git clone https://github.com/CTU-IIG/802.11p-crda.git
c2c$ cd 802.11p-crda
c2c/802.11p-crda$ git checkout its-g5_v1
# We are using our own key for regulatory.bin and CRDA
c2c/802.11p-crda$ cp /lib/crda/pubkeys/username.key.pub.pem pubkeys/
# Compile + install it
c2c/802.11p-crda$ make
c2c/802.11p-crda$ sudo PREFIX=/ REG_BIN=/lib/crda/regulatory.bin make install
# Test CRDA + generated regulatory.bin
c2c/802.11p-crda$ sudo /sbin/regdbdump ../802.11p-wireless-regdb/regulatory.bin | grep -i ocb
country 00: invalid
(5850.000 - 5925.000 @ 20.000), (20.00), NO-CCK, OCB-ONLY
# Right now is probably the right time reboot
# the computer into the newly compiled kernel
Configure OCB interface
=======================
sudo iw reg set DE
sudo ip link set wlan0 down
sudo iw dev wlan0 set type ocb
sudo ip link set wlan0 up
sudo iw dev wlan0 ocb join 5890 10MHZ
# Get the interface statistics
ip -s link show dev wlan0
@msarr11
Copy link

msarr11 commented Feb 10, 2020

Hello, has somebody tried to make it work on ath10k driver?
Thank you in advance.

@lpirl
Copy link

lpirl commented May 15, 2020

what about on kernel 5.4.x? Anyone has been able to put it working ?

This guide works for me © on Debian, with Linux 5.6 and ath9k.

If you want to patch Linux < 5.6, try the patches in this revision.

In the repository linked above, you can also find Ansible roles to set things up in an automated fashion.

Hello, has somebody tried to make it work on ath10k driver?

I have been just searching for this as well. Maybe (unlikely), I find the time to dig into ath10, but I'm really not into kernel development at all.

Also, It would be great if someone would drop a note here once he or she finds useful resources.

@lpirl
Copy link

lpirl commented May 22, 2020

Update: I just pushed the work in progress' status regarding patching ath10k for IEEE 802.11p. I am not a kernel dev, so if anyone with expertise wants to join in… :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment