Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
soc:2009:oremanj:journal:week2 [2009/06/06 11:38] rwcr |
soc:2009:oremanj:journal:week2 [2009/06/07 23:54] (current) rwcr |
||
---|---|---|---|
Line 44: | Line 44: | ||
==== Friday, 5 June ==== | ==== Friday, 5 June ==== | ||
+ | |||
+ | |||
More work on the MAC layer, to fill in the gaping "insert association functionality here" hole. No commits today, since I got to a state where the code had a dozen half-finished parts and I should be able to clean it up tomorrow. I realized I hadn't fully mapped out how the association process should work, so I took a break from the coding to do that; the notes are in my [[soc:2009:oremanj:notes:design|design notes]] page. I figure the association will be managed by a process that's created whenever it's needed. My goal is to have it appear to higher layers like the "link up" on a wired Ethernet link, so it needs to happen asynchronously - netdev_open() returns right away, and some time later the ''NETDEV_LINK_UP'' flag is automagically set (assuming everything works properly). | More work on the MAC layer, to fill in the gaping "insert association functionality here" hole. No commits today, since I got to a state where the code had a dozen half-finished parts and I should be able to clean it up tomorrow. I realized I hadn't fully mapped out how the association process should work, so I took a break from the coding to do that; the notes are in my [[soc:2009:oremanj:notes:design|design notes]] page. I figure the association will be managed by a process that's created whenever it's needed. My goal is to have it appear to higher layers like the "link up" on a wired Ethernet link, so it needs to happen asynchronously - netdev_open() returns right away, and some time later the ''NETDEV_LINK_UP'' flag is automagically set (assuming everything works properly). | ||
Line 61: | Line 63: | ||
* Milestone for next week: get the MAC layer usable by Wednesday, spend remainder of time testing and bugfixing rtl8180 boot, hopefully have working boot by end of week. | * Milestone for next week: get the MAC layer usable by Wednesday, spend remainder of time testing and bugfixing rtl8180 boot, hopefully have working boot by end of week. | ||
* Hardware purchase issues: [[http://www.amazon.com/RTL8185L-802-11g-Wireless-LAN-Adapter/dp/B0012430RS/ref=sr_1_20?ie=UTF8&s=electronics&qid=1244312934&sr=1-202009-06-06|we found a rtl8185 card]] | * Hardware purchase issues: [[http://www.amazon.com/RTL8185L-802-11g-Wireless-LAN-Adapter/dp/B0012430RS/ref=sr_1_20?ie=UTF8&s=electronics&qid=1244312934&sr=1-202009-06-06|we found a rtl8185 card]] | ||
+ | |||
+ | Commits for today: | ||
+ | * [[http://git.etherboot.org/?p=people/oremanj/gpxe.git;a=commit;h=490714353c660e66b84953444fe48f282f515019| | ||
+ | [802.11] The 802.11 MAC layer, second big commit]] | ||
+ | * [[http://git.etherboot.org/?p=people/oremanj/gpxe.git;a=commit;h=bae2489240d2eecd28a3f54bb3de3287a4aadf28| | ||
+ | [drivers rtl8180] Updated rtl8180 driver for API changes]] | ||
+ | * [[http://git.etherboot.org/?p=people/oremanj/gpxe.git;a=commit;h=095b23f38626677c11781ae9a0fedc29fde40d5d| | ||
+ | [aesthetic] Adjust parenthesis spacing on net80211.[ch] to fit gPXE style]] | ||
+ | |||
+ | I'm almost done with the initial coding for the MAC layer; all I have left to write is the network scanning function, ''net80211_probe()''. It looks like I should be able to start testing bug-hunting on Monday if not tomorrow. | ||
+ | |||
+ | I did some packet sniffing on my home wireless network today, and found that ordinary 2.4GHz-band consumer-grade networks generally don't even include the IEEE country information element that I had assumed we'd be able to use to set regulatory parameters. It may be possible to get at them with a probe packet, but if not, we're left guessing about maximum TX power - we'd have to use 20 dBm (maximum value for Europe and Japan) even in the US where a higher-range 27 dBm is allowable. For now I'm leaving it fixed at 20 always. | ||
+ | |||
+ | ==== Sunday, 7 June ==== | ||
+ | Finished the initial required MAC layer functionality, and started testing on hardware. Commits: | ||
+ | * [[http://git.etherboot.org/?p=people/oremanj/gpxe.git;a=commit;h=37f14d3d7185ce246b80b445e5909fe07ba01453| | ||
+ | [802.11] Fix sequence number fields in ieee80211.h]] | ||
+ | * [[http://git.etherboot.org/?p=people/oremanj/gpxe.git;a=commit;h=008a668a4ab75af0373bc3068ecb7102945851ff| | ||
+ | [802.11] MAC layer: Add probe functionality, other small improvements]] | ||
+ | * [[http://git.etherboot.org/?p=people/oremanj/gpxe.git;a=commit;h=0bf3c5b8d63e89da3ff4d75fb7665373ded7db99| | ||
+ | [drivers rtl8180] Fix a couple bugs, add a bunch of debugging]] | ||
+ | |||
+ | If we want to support site survey ("show me a list of networks"), most of the code in net80211_probe() can be factored out into a separate function that's called from either probe() or scan(). For now I've left scan() unimplemented. | ||
+ | |||
+ | I doubt net80211.c is going to be getting much bigger; most of the remaining code bulk will be in encryption, which I plan on making separable from the main MAC layer (so you can just compile in the encryption methods you use). Currently the code size for 802.11 is 5.8k, which IMO is not so bad. | ||
+ | |||
+ | With a couple obvious bugfixes, the rtl8180 card initializes and starts receiving packets. The first serious problem I ran into involves receiving packets of at least 85 bytes (maybe lower, but more than 64): the card signals a DMA error. Everything is aligned more than required (to 1k where the card needs 256b), all DMA is using physical addresses, the rx buffer size is set to 2356, I dunno what could be going wrong. Tomorrow I'll scrutinize my changes from the Linux driver and make sure I didn't inadvertently introduce something stupid. | ||
+ | |||
+ | It does receive a great many probe request packets from my TiVo just fine, which I think is a small victory. :-) | ||
+ |