Collected notes on the router, it's operation, and hacks. on Sunday 09 April 2006 by mattei in Notebook > Technical hits: 8382
Ethernet driver
Two bus master capable 10/100 Ethernet MACs/MII with IP checksum offloading are embedded on the RTL8186. Both must be paired with an Ethernet PHY to complete the interface. In an all-RealTek solution, this would normally be two 8201 single PHYs, an 8035 5-port switch, or a combination or the two. The GigaFast WF719-CAPR (CC & C WA-2204A) mates both MACs to an RTL8305SC, using port 4 (5th port) as the WAN interface.
I am not familiar with RealTek Ethernet Linux drivers but, with a peripheral inspection of the driver code from both Sourceforge projects and RealTek, it appears the embedded MACs are very similar to 8139s.
Wireless driver
The RTL8186 uses an embedded RTL8185 as its wireless MAC and Base Band Processor. The RTL8185 is the b/g successor to the b-only RTL8180. Unfortunately, RealTek does not provide Linux drivers for the 8180 or 8185 (recently, they have posted what appears to be a modified version of the rtl8180-sa2400 project code for 8185/7 Linux device support).
Wireless networking support in Linux is a moving target. As the technology has matured, so to have a number of separate yet functionally equivalent pieces of code. This does not affect workstation users to the extent it does embedded developers due to the relative ease of a workstation kernel upgrade. In an embedded system, kernel upgrades are rare. Required features are usually back-ported to the kernel selected during the design phase. This makes life interesting for someone who would like to use a wireless driver with a less-than-current kernel.
The proliferation of Wi-Fi code eventually brought kernel changes. Two components of that change are:
Wireless Extensions
Wireless Tools
Wireless Extensions define a kernel API for driver developers implementing hardware support. Wireless Tools provides user-space utilities that interface with Wireless Extension compliant drivers, allowing configuration and use of the device.
Each of these packages has, of course, evolved and changed over time.
Version
Kernel
Features
WE-9
2.2.14, 2.3.30
Basic 802.11b support
WE-10
2.2.19, 2.4.0
Add TxPower setting
WE-11
2.4.4
Driver version check, retry setting
WE-12
2.4.13
Additional statistics
WE-13
2.4.19, 2.5.3
New driver API
WE-14
2.4.20, 2.5.7
Wireless Scanning, Wireless Events
WE-15
2.4.21, 2.5.37
Enhanced iwpriv support
WE-16
2.4.23, 2.5.70
802.11a/802.11g fixes, Enhanced iwspy support
WE-17
2.6.10
Event capability, large scan results
WE-18
2.6.13
WPA/WPA2/802.11i support
WE-19
2.6.14
Improved dBm reporting
WE-20
Wireless-RtNetlink support
WE-21
experimental
As you can see, any modestly current wireless device driver must implement WE 16 for a/g use and WE 18 for today's security standards. If the kernel version in use does not implement the desired level of WE, the alternatives are to patch/upgrade WE to the desired level or use a third-party interface.
Kernel
WE patch level
2.4.18
WE-13
An integral part of a complete wireless system is the IEEE 802.11 network stack. While the driver handles the hardware specific details of sending and receiving wireless network packets, it is the 802.11 stack that decides when and how. An open-source, GPL stack was distributed for the Intel PRO/Wireless 2100 802.11b (Centrino), based on code from HostAP, as part of its driver package. This code seems to have been forked quite a few times, including becoming the "newstack" in the rtl8180-sa2400 project in early 2005, but eventually ended up in the kernel. Kernels before 2.6.14 require a wireless driver to bring its own stack.
Now that the kernel contains a network stack, the best course of action is to write drivers for it instead of starting from scratch. What about older kernels? The ieee80211 subsystem for Linux project is probably the best place to look. It "attempts to keep pace with inclusion of patches submitted to the netdev mailing list as well as to LKML, as well as potentially destabalizing patches." Either that, or try keeping up with HostAP and madwifi.
More to come. I have to go to the electronics store .