ieee80211_process_callback (9)
Leading comments
Copyright (c) 2004 Bruce M. Simpson <bms@spc.org> Copyright (c) 2004 Darron Broad <darron@kewl.org> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditio...
NAME
ieee80211_output - software 802.11 stack output functionsSYNOPSIS
In net80211/ieee80211_var.h Ft int Fn M_WME_GETAC struct mbuf * Ft int Fn M_SEQNO_GET struct mbuf * Ft struct ieee80211_key * Fn ieee80211_crypto_encap struct ieee80211_node * struct mbuf * Ft void Fo ieee80211_process_callback Fa struct ieee80211_node * Fa struct mbuf * Fa int FcDESCRIPTION
The net80211 layer that supports 802.11 device drivers handles most of the work required to transmit frames. Drivers usually receive fully-encapsulated 802.11 frames that have been classified and assigned a transmit priority; all that is left is to do crypto encapsulation, prepare any hardware-specific state, and push the packet out to the device. Outbound frames are either generated by the net80211 layer (e.g. management frames) or are passed down from upper layers through the ifnet(9) transmit queue. Data frames passed down for transmit flow through net80211 which handles aggregation, 802.11 encapsulation, and then dispatches the frames to the driver through it's transmit queue.There are two control paths by which frames reach a driver for transmit. Data packets are queued to the device's Vt if_snd queue and the driver's Vt if_start method is called. Other frames are passed down using the Vt ic_raw_xmit method without queueing (unless done by the driver). The raw transmit path may include data frames from user applications that inject them through bpf(4) and NullData frames generated by net80211 to probe for idle stations (when operating as an access point).
net80211 handles all state-related bookkeeping and management for the handling of data frames. Data frames are only transmit for a vap in the IEEE80211_S_RUN state; there is no need, for example, to check for frames sent down when CAC or CSA is active. Similarly, net80211 handles activities such as background scanning and power save mode, frames will not be sent to a driver unless it is operating on the BSS channel with ``full power''
All frames passed to a driver for transmit hold a reference to a node table entry in the Vt m_pkthdr.rcvif field. The node is associated with the frame destination. Typically it is the receiver's entry but in some situations it may be a placeholder entry or the ``next hop station'' (such as in a mesh network). In all cases the reference must be reclaimed with Fn ieee80211_free_node when the transmit work is completed. The rule to remember is: net80211 passes responsibility for the Vt mbuf and ``node reference'' to the driver with each frame it hands off for transmit.
PACKET CLASSIFICATION
All frames passed by net80211 for transmit are assigned a priority based on any vlan tag assigned to the receiving station and/or any Diffserv setting in an IP or IPv6 header. If both vlan and Diffserv priority are present the higher of the two is used. If WME/WMM is being used then any ACM policy (in station mode) is also enforced. The resulting AC is attached to the mbuf and may be read back using the Fn M_WME_GETAC macro.PAE/EAPOL frames are tagged with an M_EAPOL mbuf flag; drivers should transmit them with care, usually by using the transmit rate for management frames. Multicast/broadcast frames are marked with the M_MCAST mbuf flag. Frames coming out of a station's power save queue and that have more frames immediately following are marked with the M_MORE_DATA mbuf flag. Such frames will be queued consecutively in the driver's Vt if_snd queue and drivers should preserve the ordering when passing them to the device.