In the system, the 802.11 driver sends data packets transmitted by the upper-layer protocol to the chip, and transmits the data received by the chip to the corresponding upper-layer protocol stack.
The default link layer data of Windows CE network layer protocol is in Ethernet II format. However, the data received by the host from the WiFi chip is in the 802.11 format. Therefore, you must convert the format when sending and receiving data.
The 802.11 Protocol specifies the standard interfaces for Mac and upper-layer communication. The host driver communicates with the chip through these standard interface commands.
The 802.11 Protocol MAC data service defines an interface for sending and receiving data packets:
MA-UNITDATA.request (
Source Address,
Destination Address,
Routing information,
Data,
Priority,
Service Class
)
And
MA-UNITDATA.indication (
Source Address,
Destination Address,
Routing information,
Data,
Prediction status,
Priority,
Service Class
)
802.11i defines another interface for sending eapol data packets:
MLME-EAPOL.request (
Source Address,
Destination Address,
Data
)
The data structure is as follows:
| Snap | control | 0x00-00-00 | type | IP packet | FCS |
| DSAP | SSAP | or |
| 0xaa | 0xaa | 0x03 | 0x00-00-f8 | 2 bytes | 4 bytes |
The Ethernet II frame structure is:
| Destination Address | source address | type | IP packet | FCS |
| 6 bytes | 6 bytes | 2 bytes | 4 bytes |
In these interfaces, source address and destination
Address.
II corresponds to the corresponding part. In the data section, we can see that, except the first six bytes, the following parts and Ethernet
In section II, the data except the address is the same. Therefore, we only need to add the first six bytes at the time of sending and remove the six bytes at the time of receiving.
Data
The fourth to sixth bytes in the statement indicate the method of encapsulating LLC data. 0x00-00-00 indicates rfc1042, and 0x00-00-f8 indicates 802.1 H. Systems at Microsoft
By default, appletalk and IPX protocol stacks use 802.1 h, while rfc1042 is used for other protocols. Therefore, you can use Ethernet
Type in II determines the method to use. We currently determine that if type is equal to 0x80f3 (appletalk
AARP) or 0x8137 (IPX) is 802.1 h; otherwise, rfc1042 is used.
In addition, when sending data, if the type is 0x888e, expressed as an eapol packet, you need to use a MLME-EAPOL.reques to send data; and the received eapol packet is still obtained from the MA-UNITDATA.indication as a normal packet.