Please note: This project is no longer active. The website is kept online for historic purposes only.
If you´re looking for a Linux driver for your Atheros WLAN device, you should continue here .

Changes between Version 22 and Version 23 of About/HAL

Author:
mrenzmann (IP: 0.0.0.0)
Timestamp:
09/20/07 16:17:45 (11 years ago)
Comment:

Adjusted for new website layout.

Legend:

Unmodified
Added
Removed
Modified
  • About/HAL

    v22 v23  
    1 [[PageOutline(2)]] 
     1[[PageOutline(2-5)]] 
    22 
    3 = The MadWifi HAL = 
     3= HAL = 
    44 
    5 == What is the HAL? == 
     5This term is short for "Hardware Abstraction Layer". In context of !MadWifi it refers to a piece of software that all direct access to the Atheros hardware is routed through. Please note that the [http://www.freedesktop.org/wiki/Software/hal HAL] promoted by freedesktop.org. 
    66 
    7 HAL is short for Hardware Abstraction Layer. Think of it being something like the firmware of the card, with the only difference that it isn’t stored inside the card. Instead, the HAL is a kernel module which implements an API to present the hardware to the driver in a nice, uniform fashion. It is not exactly like firmware, because ‘firmware’ is a term which generally refers to code executed by an onboard microcontroller or DSP in other pieces of hardware). And yes, the HAL is closed source and only available as ready compiled binary for a bunch of different architectures. 
     7Unlike many other wireless devices Atheros chipsets can use a wide range of frequencies and the host software can control many aspects of the radio. Regulatory agencies all over the world have laws which restrict the use of the wireless spectrum to certain frequency bands under specific transmission power levels. These laws drive wireless manufacturers to come up with solutions to enforce compliance with the wide array of regulatory agencies. 
    88 
    9 To easily see architectures the HAL is built for, see: source:/trunk/hal/public 
     9The original !MadWifi author, Sam Leffler, and Atheros agreed on the concept of using a proprietary HAL as wrapper around the hardware registers. The HAL is distributed in binary form only, so that unauthorized users can not easily modify it. It ensures that non-compliant settings are not applied to the radio, while allowing the open source part of the driver to interact with the chipset in a permissive manner. It's a compromise that tries to meet the requirements of both, the open source community and the regulatory agencies. 
    1010 
    11 If the version you need isn’t there, then consider asking (nicely) on the madwifi-devel list. 
     11== Frequently Asked Questions == 
    1212 
    13 == Why is the HAL closed source? == 
     13In the following we would like to answer some of the most often asked questions about the binary HAL. 
    1414 
    15 The Atheros chipsets can tune to a wide range of frequencies, part of them being outside the bands that are permitted for unlicensed use (ISM-bands). Non-ISM-frequencies are licensed by various regulatory agencies for different purposes, such as military or civil radar use, military communications, wireless local loop installations, and so on. Furthermore, there may be regulations on the allowed transmission power on different frequencies, and on conditions such as indoor or outdoor use. 
     15=== Is the HAL some kind of firmware? === 
    1616 
    17 The Atheros chipsets are capable of operating on frequencies outside those that are licensed, or legal to use without a license, and can vary the transmission power on these frequencies. So there must be some mechanism for enforcing the frequencies that are used. The limitations in regards to legal frequencies and transmission power change depending on the given region (such as Japan, UK, USA, etc), thus the HAL changes its behaviour depending on the 'regdomain' and country code. 
     17Not exactly. The HAL performs tasks similar to that of a firmware, such as implementing an API to present the hardware to the driver in a nice, uniform fashion. But the term 'firmware' generally refers to code executed by an onboard microcontroller or DSP on the controlled device, while the HAL is executed on the host CPU.  
     18 
     19=== Why is the HAL closed source? === 
     20 
     21As explained above, the Atheros chipsets can tune to a wide range of frequencies, part of them being outside the bands that are permitted for unlicensed use (ISM-bands). Non-ISM-frequencies are licensed by various regulatory agencies for different purposes, such as military or civil radar use, military communications, wireless local loop installations, and so on. Furthermore, there may be regulations on the allowed transmission power on different frequencies, and on conditions such as indoor or outdoor use. 
     22 
     23The Atheros chipsets are capable of operating on frequencies outside those that are licensed, or legal to use without a license, and can vary the transmission power on these frequencies. So there must be some mechanism for enforcing the frequencies that are used. The limitations in regards to legal frequencies and transmission power change depending on the given region (such as Japan, UK, USA, etc), thus the HAL changes its behaviour depending on the regulatory domain and country code. 
    1824 
    1925At least the USA Federal Communications Commission (FCC) requires that any manufactured products have a mechanism for limiting transmission power and frequencies, and that these mechanisms are not easily modifiable by the consumer. If you are in a region that limits the number of frequencies, say, Japan, it is illegal to broadcast out of those assigned channels, even though the chip is capable of operating outside of the limited frequency band assigned by Japan. 
    2026 
    21 == Isn't binary-only code EVIL? == 
     27=== Isn't binary-only code EVIL? === 
    2228 
    23 The Free Software and Open Source movements have good reasons for their philosophies and ideologies and you can read about them on their websites. However, due to regulations by regulatory authorities for the airwaves, Atheros is unable to release open specifications and/or code to set frequencies and transmission powers. 
     29The Free Software and Open Source (FOSS) movements have good reasons for their philosophies and ideologies and you can read about them on their websites. However, due to regulations by regulatory authorities for the airwaves, Atheros sees itself unable to release open specifications and/or code to set frequencies and transmission powers. 
    2430 
    25 Thankfully, Atheros and Sam Leffler have shown a lot of commitment to the Linux platform, so most of us are happy to have Atheros cards in our computers.  
     31On the other hand, the binary HAL forces developers to deal with a black box that they can neither fix nor fully understand. The fact that Atheros and Sam Leffler have shown a lot of commitment to the Linux platform mitigates that a bit fortunately. 
    2632 
    27 == Should I be worried that if Atheros goes out of business that the HAL will no longer be available? == 
     33As far as the !MadWifi team is concerned: we did support the HAL approach as long as no acceptable alternative existed, but decided to take a different road. The binary HAL is not evil per se, but we see alternative ways to achieve the same goal with fewer negative side effects. 
    2834 
    29 The HAL will always be available, as long as you have a copy of it. But it might well be that it won’t be developed further in this case, but that’s the same problem you’ll face with virtually any other vendor. I.e. if Prism were to go out of business the firmware for their cards would no longer be actively developed, but would still be available on the net. 
     35=== What happens if Atheros goes out of business? === 
    3036 
    31 == What licensing issues are there in having non-free software in Linux (the kernel)? == 
     37The HAL will always be available, as long as you have a copy of it. But it might well be that it won't be developed further in this case, but that's the same problem you'll face with virtually any other vendor. I.e. if Prism were to go out of business the firmware for their cards would no longer be actively developed, but would still be available on the net. 
    3238 
    33 If you want to see Linus’ view on firmware vs binary drivers, [http://www.win.tue.nl/~aeb/linux/lk/COPYING-modules.txt here's] a collection of his e-mail on the subject. Interestingly, Linus says: You just can’t make a binary module for Linux, and claim that that module isn’t derived from the kernel. Because it generally is - the binary module not only included header files, but more importantly it clearly is _not_ a stand-alone work any more. So even if you made your own prototypes and tried hard to avoid kernel headers, it would _still_ be connected and dependent on the kernel. 
     39=== What about licensing issues? === 
    3440 
    35 MadWifi gets around this by applying orthogonality to the problem. Rather than use a single precompiled binary module, the HAL module is split into two sections: the precompiled binary and ah_os.o (which comprises of [source:trunk/ath_hal/ah_os.c ah_os.c], [source:trunk/ath_hal/ah_os.h ah_os.h] and [source:trunk/ath_hal/ah_osdep.h ah_osdep.h]) that acts as an intermediary between the kernel and the binary HAL. The two sections are linked, and together they become the LKM (loadable kernel module) ath_hal.o
     41If you want to see Linus' view on firmware vs binary drivers, [http://www.win.tue.nl/~aeb/linux/lk/COPYING-modules.txt here's] a collection of his e-mail on the subject. Interestingly, Linus says: You just can't make a binary module for Linux, and claim that that module isn't derived from the kernel. Because it generally is - the binary module not only included header files, but more importantly it clearly is _not_ a stand-alone work any more. So even if you made your own prototypes and tried hard to avoid kernel headers, it would _still_ be connected and dependent on the kernel
    3642 
    37 This design orthogonality means that the HAL binary is able to work without modification on any version of the linux kernel, as well as the BSDs, and a few other embedded projects. All that needs modifying is the ah_osdep.c, which must map HAL and kernel function calls to one another. 
     43!MadWifi gets around this by applying orthogonality to the problem. Rather than use a single precompiled binary module, the HAL module is split into two sections: the precompiled binary and ah_os.o (which comprises of [source:trunk/ath_hal/ah_os.c ah_os.c], [source:trunk/ath_hal/ah_os.h ah_os.h] and [source:trunk/ath_hal/ah_osdep.h ah_osdep.h]) that acts as an intermediary between the kernel and the binary HAL. The two sections are linked, and together they become the loadable kernel module ath_hal.o. 
     44 
     45This design orthogonality means that the HAL binary is able to work without modification on any version of the Linux kernel, as well as the BSDs, and a few other embedded projects. All that needs modifying is the ah_osdep.c, which must map HAL and kernel function calls to one another. 
    3846 
    3947So, to conclude, hal.o (the binary module) is not a derived work of the linux (or any other) kernel, however {{{ath_hal.o}}} (the fully built and linked module) is, because the file ah_osdep.o does all of the OS specific mapping. 
    4048 
    41 == What kind of access does the HAL have to my system's internals? == 
     49=== What kind of access does the HAL have to my system's internals? === 
    4250 
    43 Because the HAL is a kernel module it runs in kernel space. It can therefore do anything it wants to any of the system's internals. However, all access to and from the HAL is done through the OS dependent wrapper, at least, as far is verifiable. However, standard problems with pointers and memory access in low-level languages remain. 
     51Because the HAL is a kernel module it runs in kernel space. It can therefore do anything it wants to any of the system's internals. However, all access to and from the HAL is done through the OS dependent wrapper, at least, as far is verifiable. Standard problems with pointers and memory access in low-level languages remain. 
    4452 
    45 == What does 'ath0: HAL ABI mismatch' mean? == 
     53=== Are there alternatives to the binary HAL? === 
    4654 
    47 This message occurs when the actual HAL interface doesn’t match the interface that the driver is expecting. It generally happens when there was a cvs checkout problem, or you try to use an old HAL with the driver. If you have updated the source by doing 
    48 {{{ 
    49 svn update 
    50 }}} 
    51 in the madwifi-ng source directory you should be sure to do 
    52 {{{ 
    53 make clean 
    54 }}} 
    55 this way ath_hal.ko will be updated and built also. 
    56  
    57 == I still don't like it. Are there alternatives? == 
    58  
    59 In terms of functionality there is not yet an equivalent alternative to the Atheros HAL. But at least two projects exist which aim at reverse-engineering the HAL in order to make a complete open source solution: 
    60  
    61  * the ath driver from http://openbsd.org/ with the infamous [wiki:About/OpenHAL] 
    62  * [wiki:About/OpenHAL] port to [wiki:About/MadWifi]/Linux 
    63  
    64 ath-driver.org also used to be mentioned here, but it seems to be no longer available. 
    65  
    66 == Page Contributors == 
    67  * Alvin Oga 
    68  * Bob Lockie (supplier of questions) 
    69  * Gerald Britton 
    70  * Jim Thompson 
    71  * Larry Bakst 
    72  * Matt Foster (previous maintainer) 
    73  * Michael Renzmann 
    74  * Michael Schwingen 
    75  * Per Bjornsson 
    76  * Silas Bennett 
    77  * John Clark 
    78  * Thorsten von Eicken 
    79  * Matthew W. S. Bell (maintainer) 
    80  
    81 Please note that all information is entirely fictional; There is no relation to real people or events, implied or otherwise. 
     55In terms of functionality there is not yet an equivalent alternative to the Atheros HAL, but [wiki:About/OpenHAL we're working on it].