Joshua Oreman: 802.11 wireless development

Journal Week 10

Tuesday-Thursday, 28-30 July

I've been working on getting the ath5k driver gPXEfied:

I've gotten it to a compilable state, and fixed what runtime bugs I could, but I've run up against one that suggests no more fruitful approach than shooting in the dark:

ath5k: resetting for channel change (2422 -> 2447 MHz)
ath5k: reset to channel 0x2b0b4 (2447 MHz)
ath5k: txq [u] 0, link 0x0
ath5k: hw reset to channel 0x2b0b4 (2447 MHz)
  <~1second pause>
ath5k: noise floor calibration timeout (2447 MHz)

Without the noise floor calibration (comments and observation suggest) the card can't receive any packets. A further analysis of the registers reveal that upon setting the NF calibrate bit, nothing happens - the bit remains set (it should be cleared by the card once calibration starts) and the noise floor register doesn't change.

Suffice it to say, I'm rather confused.

Friday, 31 July

Fixed the noise floor issue, but it's still not receiving packets.

The noise floor issue was just the first manifestation of a bug that would seem completely unrelated to it. In the Linux driver code, the various modes of operation (A, B, G, ATurbo, GTurbo, XR) were defined as monotonically increasing enumeration values 0, 1, 2, …, and then frequently used to set bitfields. In my initial translation of the code for gPXE, I had thought this bitfield use was all that the mode values were put to, and redefined the modes to be powers of two. This worked for everything except part of the initialization sequence where the current mode is used to index an array.

For my card, the 802.11g mode had value 3 in the original enumeration, and 8 in my power-of-2 modification. The mode value is used to index a 5-element array. The net result was that register A in 802.11g mode would be initialized with the value that should be used for register A+1 in 802.11b mode. As you might guess, this caused… some issues, of which the noise floor calibration failure was simply the first to appear.

I've since tested the card in Linux and gotten it to work, so I didn't permanently damage my hardware with this coding bug.

Packets are still not being received properly, but the fix will probably reveal itself after slogging through enough diffs and debug statements. I hope to have this driver completely working by the end of next week.

Saturday, 1 August

Had a meeting this morning. Priorities for the remaining two weeks of GSoC:

  • For the week of 2 August:
    • Get ath5k finished.
    • Figure out why REQUIRE_OBJECT() doesn't produce a link error for nonexistent objects, and determine the best way to express a dependency of the form “require X if Y is linked in”, alternately “produce undefined symbol X if symbol Y is defined”. Ideally this would be expressible in C, but if not, we can do it with linker script fragments generated on the fly by a script.
  • For the week of 9 August:
    • Get encryption code, firmware loading, and ath5k driver ready for mainline review.
    • Document!
      • A page for users wanting to boot wirelessly.
      • A page for 802.11 driver developers.
      • Time permitting, a semi-organized brain dump of the 802.11 information I've gleaned over the summer. It's all in the spec, but the spec goes into detail so quickly that it creates a feeling of drowning. A gentler introduction may help future developers.
  • And beyond…


The iwmgmt commit is awaiting a more general solution for the problem of “require this object only if this subsystem is already compiled in”, which I'll be working on over the next weeks.

QR Code
QR Code soc:2009:oremanj:journal:week10 (generated for current page)