GSoC 2012 – First steps

Here comes the first blog story about my progress during GSoC 2012.

I am accepted as a GSoC student by Linux Foundation to work on their video driver backport project. The idea is basically about integrating a modern 3D video driver into a compat framework and adding support for backporting it from linux-next.git down to all known supported kernel releases. The initial project idea of Linux Foundation is here.

My mentor is Luis R. Rodriguez which is currently maintaining compat and compat-wireless trees to distribute latest 802.11, Bluetooth subsystem/drivers and some ethernet drivers in source code form. This way, a user either by using their distribution’s package repository or by compiling the compat-wireless tarballs can get access to the latest drivers without needing to build their kernel from scratch.

The compat.git and compat-wireless.git trees are hosted in github.

compat tree

The compat tree is basically for providing the functionalities added in newer kernels to older kernels using a set of header files and exported symbols. A very detailed explanation about the compat framework can be found in the wiki page.

The changes for a subsystem targeted for the upcoming/next major kernel release are kept in subsystem-next.git trees. These changes are merged into the linux-next.git tree on a daily basis. This means that changes targeted for the next kernel release can be backported into the compat.git tree in advance.

compat-wireless tree

The compat-wireless.git tree is basically a placeholder tree with a bunch of scripts and networking specific backport patches in which automated releases are built.

Basically you set up your environment variables to point to the relevant GIT trees to generate compat-wireless tarballs using stable or next trees as your code base. The mechanism also benefits from the compat.git tree as it is crucial for adding support of new functionalities for older kernels.

More info can be found at linux wireless hacking page.

An example backport

In order to get my hands dirty, I prepared and sent a patch for compat.git to backport the newly added ether_addr_equal() function. Since the change is committed to the linux-next.git tree, the backport is needed for generating compat-wireless tarballs from the linux-next.git tree.

Since all kernel code doing an address equality check are modified to use this new function instead of the older compare_ether_addr(), the backport is and should actually be a wrapping around the older function in order to ease the backporting work:

/* Backport ether_addr_equal */
static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2)
    return !compare_ether_addr(addr1, addr2);

With this commit, all code in the linux-next.git tree using the new ether_addr_equal() function will correctly build on older kernels because it is now defined through the compat.git tree.