Publications

Code Analysis of the Linux Wireless Team's ath5k Driver

27 September 2007

Download PDF | Download Postscript

1 Executive summary

The Software Freedom Law Center (SFLC) carried out an exhaustive, detailed, diachronic review of the Linux ath5k driver (“ath5k-driver”). SFLC has determined that the changes made by the Madwifi and Linux Wireless developers to generate ath5k-driver constitute copyrightable work derived from the original ar5k sources. In addition, SFLC has determined that the various branches of the code hosted currently by Madwifi on its madwifi-old-openhal branch (“madwifi-old-openhal”) and its ath5k branch (“ath5k-branch”) also constitute copyrightable derivatives of ar5k.

Furthermore, SFLC has determined that code derived from ar5k, which now appears in both the ath5k-driver and the madwifi-old-openhal branch, can be released under the ISC license without difficulty. In particular, all new copyright holders in the ath5k-driver code have been contacted and have agreed to license their changes to the relevant parts of the driver under the ISC license. However, releasing the ath5k-branch in the Madwifi SVN under any license other than GPL would be exceedingly difficult due to the incorporation of GPL’d work early in that branch’s development.

This document discusses some technical details of the analysis by SFLC supporting these conclusions. A companion document which specifically addresses originality requirements in copyright law accompanies the release of this paper.

2 Analysis of ath5k-driver

Ath5k-driver is currently carried by Linux developer John Linville in his wireless-legacy git repository 1 on ath5k-branch.2

The Madwifi team, the Linux Wireless team and others have been developing ath5k-driver since September 2005. Ath5k-driver began as a fork of OpenBSD’s ar5k, developed by Reyk Floeter. Ath5k-driver is not only an adaptation of ar5k for Linux, but also includes work done by the various developers to refactor the code, change its 802.11 stack dependency, and consolidate and optimize the code for Linux.

Ath5k-driver consists of eight files, and uses the file-by-file copyright inventory method.3

The file ath5k.h seems to be derived from ar5k’s ar5xxx.h and perhaps a few other header files. This file is primarily an arrangement of constants, storage structures, and the like for the Atheros cards. The extent to which this type of work is copyrightable is debatable. However, the parts that are likely to be copyrightable—the arrangements and representations of the structures—are clearly very different from corresponding parts in the ar5k files. Macros have been refactored, various #defines have been organized into enums, numerous typedefs have been changed to match Linux style, and some function prototypes have changed. Finally, the presentation of the material has been rearranged and reorganized.

The files ath5k_base.c and ath5k_base.h do not appear to be derived at all from ar5k. They are derived from source code released in conjunction with the Atheros proprietary HALs that were once the focus of Madwifi development. The license and copyright notices on these files, therefore, correctly are not similar to Floeter’s copyright notice and license.

The file ath5k_hw.h contains various components from ar5k’s header files, mostly from ar5xxx.h. The file primarily includes constants and structures related to the card. Again, the copyrightability of such work is minimal, but the presentation of the factual information about the card layout, which is the primary copyrightable component, has been changed substantially. The information has been reorganized and renamed, and the macros have been refactored to fit Linux style.

The file ath5k_hw.c abstracts functions that ar5k originally spread across its ar5210.c, ar5211.c, and ar5212.c files. Ar5k treated each version of the card differently, while ath5k-driver instead has generalized functions for card operations. While some functions here are substantially similar, creative and careful work has adapted the return values for Linux. Meanwhile, in many functions some minor refactoring is found. The most substantial and the most substantive changes relate to the generalization of the functions. Careful work has been done to abstract away the differences between the versions of the card and to make each function operate on all cards. In many cases, if statements have been created to handle special cases for particular cards (whereas in ar5k, an entirely different function is used).

The file ath5k_inivals.c is actually more a header file than a code file, as it contains only two functions. Mostly, as is seen with ath5k_hw.h and ath5k.h, the file contains various constants and tables of data organized for the registers on the card. It corresponds primarily to ar5212reg.h and ar5212var.h in ar5k.

The data in ath5k_inivals.c has obviously been reorganized and restructured, and in some cases refactored. For example, ar5k uses macros to build various tables:

#define AR5K_AR5212_RATE_DUR_0 0x8700  
#define AR5K_AR5212_RATE_DUR(_n) (AR5K_AR5212_RATE_DUR_0 + ((_n) << 2))

while ath5k-driver does the following:

{ AR5K_RATE_DUR(0),0x00000000 },  
{ AR5K_RATE_DUR(1),0x0000008c },  
{ AR5K_RATE_DUR(2),0x000000e4 },

The file ath5k_phy.c contains the data and constants that appear to be derived from ar5k’s ar5210var.h. The functions in this ath5k_phy.c are derived from functions pulled from various places in ar5k (mostly ar5212.c, ar5210.c and ar5xxx.c). There are few changes to the constants and numerical tables. Unlike the other header files, these constants and data concerning the card appear to be very close to the presentation of these constants and data in ar5k. In only one case, in the RF_GAIN tables, does ath5k-driver refactor and use a different format to build a table.

Nevertheless, the functions in ath5k_phy.c represent novel and creative work. In many cases in this file, the ath5k-driver function represents a merger of ar5k functions that were unique to specific chipsets. The methods employed here to merge and refactor the functions are very similar to ath5k_hw.c.

The file ath5k_reg.h is nearly all constants and table data, and is based on ar5k’s ar5210reg.h. The two files are presented in mostly the same way, with a global rename of the various constants. There is some minor refactoring in some places. However, the principal creative work added in ath5k-driver consists of comments regarding the purpose of the various constants. This addition is clearly a copyrightable change.

It should be noted, however, that a table of constants, such as that found in ath5k_reg.h, is not necessarily within scope of copyright. The constants themselves, and the names they are given, particularly where a name represents a standard way of describing the purpose of the constant, will often fall outside the scope of copyright. However, the arrangement, organization, presentation, and comments regarding the constants are almost certainly within scope of copyright, and the developers of both ar5k and the ath5k-driver have contributed to those components. The copyright notices for all such contributors should appear in this file, but those examining the file should note that the copyright does not actually cover the facts that the file presents, only the arrangement and descriptions of those facts.

The file ath5k_regdom.c contains only a few short functions, and appears to come directly from .../net80211/ ieee80211_regdomain.c in the OpenBSD tree. No additional copyrights were claimed by ath5k-driver developers, since hardly any changes were made, and those that were are almost certainly outside the scope of copyright.

The file ath5k_regdom.h is almost exactly the same as .../net80211/ieee80211/regdomain.h from the OpenBSD tree. Again, there are no additional copyrights by ath5k-driver developers; it appears that the only change made was a renaming.

3 Analysis of madwifi-old-openhal

While under development, the software that ultimately became the ath5k-driver was hosted in various places. On 2006-02-23, Nick Kossifidis posted to a mailing list4 stating that he was working in an SVN repository of his own creation on the earliest versions. An exact and unmodified copy of Kossifidis’ work later appeared on 2006-08-03 in a git repository made available by Mateusz Berezecki.5

However, the primary permanent public hosting of this work appears to have begun on 2006-12-05 when Luis Rodriguez imported code into madwifi-old-openhal in Madwifi-SVN at r1830. This commit includes all the work done by Kossifidis from late 2005 until August 2006. (The full branch is available for browsing at http://madwifi.org/log/branches/madwifi-old-openhal/openhal.)

A careful inspection of this branch in Madwifi-SVN shows that many developers contributed copyrightable changes to madwifi-old-openhal. In particular, the work was developed and improved with copyrightable changes by Rodriguez, Kossifidis, Matthew W. S. Bell, Pavel Roski, and Michael Taylor.

On 2007-06-13, Jiri Slaby forked from madwifi-old-openhal at r2441. Slaby used git to store his work.6

Analysis showed that Slaby’s work in his own git repository from 2007-06-13 until 2007-08-09 yielded a single result that included his work and various madwifi-old-openhal changes. In particular, on 2007-06-22 and 2007-06-23 he merged in what appears to be madwifi-old-openhal at r2502. On 2007-07-15, Slaby merged in madwifi-old-openhal at r2539. Finally, on 2007-08-12, Slaby sent this work as a single patch to Linville.7 The version in Slaby’s git repository matches what is now carried by Linville, and which is referred to as ath5k-driver in this report and discussed in detail in Section 2.

4 Analysis of ath5k-branch

In Madwifi-SVN, there is a another area where a derivative of ar5k is maintained. Ath5k-branch8 was developed mostly in parallel both to Slaby’s work and to the ongoing work on madwifi-old-openhal.

Ath5k-branch was started by Kossifidis on 2007-08-26 at r2670. Kossifidis started from r2669 of madwifi-old-openhal but incorporated various components from other parts of Madwifi-SVN. Since much of Madwifi-SVN has code licensed under the GPL, and because we have no revision history between r2669 and r2670, it would be somewhat difficult to back out changes made at that revision where such changes are copyrightable and released under the GPL.

Therefore, it is our recommendation that ath5k-branch remain licensed under the GPL to best reflect the licensing intentions of those who held copyright on code taken from elsewhere in Madwifi-SVN and incorporated into ath5k-branch at r2670.

5 ISC-licensed ath5k-driver development

The Linux Wireless Team, along with some Madwifi developers, have indicated a desire to collaborate with the OpenBSD team working on ar5k.

SFLC believes that this collaboration is entirely feasible. While it would be difficult to use the ath5k-branch for such collaboration, some developers have indicated that this branch can be retired.

Ath5k-driver (discussed in Section 2) currently carried by Linville represents a clear and documented line of descent from ar5k to an ath5k driver for Linux. In addition, all new copyright holders in ath5k-driver code have been contacted and have agreed to license their changes to the ar5k-derived files under the ISC license.9 SFLC has provided a patch to Linville that provides correct attributions for all copyright holders in question. Therefore, SFLC recommends that development under the ISC license continue from what is currently in Linville’s commit c1928199c27de433d1e81b78e3178be4f0e978d2 in his ath5k branch of the wireless-legacy git repository.

We refer developers to our guidelines on maintaining permissive-licensed files in a GPL-licensed project for guidance on how to carry out this development cleanly.

Copyright © 2007 Software Freedom Law Center, Inc. Verbatim copying and distribution of this document is permitted in any medium provided this notice is preserved.

1The URL of Linville’s wireless-dev git repository is git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-legacy.git.

2Linville’s commit on his “ath5k” is commit c1928199c27de433d1e81b78e3178be4f0e978d2.

3The “file-by-file copyright inventory method”, or the “file-by-file method” for short, is the typical method used by FOSS projects for keeping track of copyright holders on the various parts of a work. By contrast, some projects keep a single file (typically called “COPYRIGHT”) at the top level of the project that lists all copyright holders.

4The post is available at http://lists.gnumonks.org/pipermail/ath-driver-devel/2006-February/000179.html.

5A post announcing the git repository is available at http://lists.gnumonks.org/pipermail/ath-driver-devel/2006-August/000397.html.

6Slaby’s git repository is available at http://decibel.fi.muni.cz/~xslaby/git/madwifi-openhal2/

7Slaby’s patch to Linville is available online at http://www.kernel.org/pub/linux/kernel/people/linville/wireless-dev/ath5k/0001-Net-add-ath5k-wireless-driver.patch.

8Ath5k-branch can be browsed online in Madwifi-SVN at http://madwifi.org/log/branches/ath5k.

9Note that two files in ath5k-driver, namely ath5k_base.c and ath5k_base.h, are not derived from ar5k and are therefore licensed under the terms from their original sources and shall remain such.