<script type="text/javascript"> document.body.oncopy = function() { if (window.clipboardData) { setTimeout(function() { var text = clipboardData.getData("text"); if (text && text.length > 300) { text = text + "/r/n/n本文来自优快云博客,转载请标明出处:" + location.href; clipboardData.setData("text", text); } }, 100); } } </script>
数据发送过程:
The kernel calls ieee80211_hardstart() (dev->hard_start_xmit of the virtual interface) to transmit a packet, which in turn calls ath_hardstart() (dev_hard_start_xmit of the physical interface). The function ath_hardstart() encapsulates the ethernet packet into 802.11 packet. The function ath_tx_start() encrypts the packets if necessary, maps the skb to DMA buffer and selects a transmit queues acording the priority of the packets (QoS control). The function ath_tx_txqaddbuf() inserts the buffer into the selected transmit queue and calls the HAL function to start a transmission.
Management packets are generated within the 802.11 layer. They are transmitted from the function ieee80211_mgmt_output().
Beacon messages are trigered by HAL. When it's time to send a beacon, the HAL issues an interrupt, then the function ath_beacon_send() is invoked to send the beacon message. The beacon messages are directly passed to the HAL to transmit.
After the HAL successfully transmited a packet, an interrupt is generated (ath_intr() ) to report the transmission of the packet as shown in the following figure. The function ath_tx_tasklet() updates infomation for this transmission. If there is a virtual interface working in monitor mode, the packet is passed to the monitor interface in function ath_tx_capture() .