iPXE
Data Fields
net80211_device Struct Reference

Structure encapsulating the complete state of an 802.11 device. More...

#include <net80211.h>

Data Fields

struct net_devicenetdev
 The net_device that wraps us.
struct list_head list
 List of 802.11 devices.
struct net80211_device_operationsop
 802.11 device operations
void * priv
 Driver private data.
struct net80211_hw_infohw
 Information about the hardware, provided to net80211_register()
struct net80211_channel channels [NET80211_MAX_CHANNELS]
 A list of all possible channels we might use.
u8 nr_channels
 The number of channels in the channels array.
u8 channel
 The channel currently in use, as an index into the channels array.
u16 rates [NET80211_MAX_RATES]
 A list of all possible TX rates we might use.
u8 nr_rates
 The number of transmission rates in the rates array.
u8 rate
 The rate currently in use, as an index into the rates array.
u8 rtscts_rate
 The rate to use for RTS/CTS transmissions.
u32 basic_rates
 Bitmask of basic rates.
struct process proc_assoc
 The asynchronous association process.
struct net80211_wlanassociating
 Network with which we are associating.
union {
   struct net80211_probe_ctx *   probe
   struct net80211_assoc_ctx *   assoc
ctx
 Context for the association process.
struct net80211_handshakerhandshaker
 Security handshaker being used.
u16 state
 State of our association to the network.
int assoc_rc
 Return status code associated with state.
union ieee80211_iersn_ie
 RSN or WPA information element to include with association.
struct net80211_cryptocrypto
 802.11 cryptosystem for our current network
struct net80211_cryptogcrypto
 802.11 cryptosystem for multicast and broadcast frames
u8 bssid [ETH_ALEN]
 MAC address of the access point most recently associated.
char essid [IEEE80211_MAX_SSID_LEN+1]
 SSID of the access point we are or will be associated with.
u16 aid
 Association ID given to us by the AP.
u64 last_beacon_timestamp
 TSFT value for last beacon received, microseconds.
u32 tx_beacon_interval
 Time between AP sending beacons, microseconds.
u32 rx_beacon_interval
 Smoothed average time between beacons, microseconds.
int phy_flags
 Physical layer options.
int last_signal
 Signal strength of last received packet.
struct rc80211_ctxrctl
 Rate control state.
struct net80211_frag_cache frags [NET80211_NR_CONCURRENT_FRAGS]
 Fragment reassembly state.
u16 last_tx_seqnr
 The sequence number of the last packet we sent.
u16 last_rx_seq
 Packet duplication elimination state.
struct list_head mgmt_queue
 RX management packet queue.
struct list_head mgmt_info_queue
 RX management packet info queue.
int keep_mgmt
 Whether to store management packets.

Detailed Description

Structure encapsulating the complete state of an 802.11 device.

An 802.11 device is always wrapped by a network device, and this network device is always pointed to by the netdev field. In general, operations should never be performed by 802.11 code using netdev functions directly. It is usually the case that the 802.11 layer might need to do some processing or bookkeeping on top of what the netdevice code will do.

Definition at line 786 of file net80211.h.


Field Documentation

List of 802.11 devices.

Definition at line 792 of file net80211.h.

Referenced by net80211_check_settings_update(), net80211_get(), net80211_register(), and net80211_unregister().

The rate to use for RTS/CTS transmissions.

This is always the fastest basic rate that is not faster than the data rate in use. Also an index into the rates array.

Definition at line 831 of file net80211.h.

Referenced by ath5k_config(), ath9k_config(), net80211_cts_duration(), net80211_set_rtscts_rate(), and rtl818x_config().

Bitmask of basic rates.

If bit N is set in this value, with the LSB considered to be bit 0, then rate N in the rates array is a "basic" rate.

We don't decide which rates are "basic"; our AP does, and we respect its wishes. We need to be able to identify basic rates in order to calculate the duration of a CTS packet used for 802.11 g/b interoperability.

Definition at line 843 of file net80211.h.

Referenced by net80211_marshal_request_info(), net80211_process_ie(), and net80211_set_rtscts_rate().

The asynchronous association process.

When an 802.11 netdev is opened, or when the user changes the SSID setting on an open 802.11 device, an autoassociation task is started by net80211_autoassocate() to associate with the new best network. The association is asynchronous, but no packets can be transmitted until it is complete. If it is successful, the wrapping net_device is set as "link up". If it fails, assoc_rc will be set with an error indication.

Definition at line 858 of file net80211.h.

Referenced by net80211_alloc(), net80211_autoassociate(), net80211_netdev_close(), and net80211_step_associate().

Network with which we are associating.

This will be NULL when we are not actively in the process of associating with a network we have already successfully probed for.

Definition at line 866 of file net80211.h.

Referenced by iwstat(), net80211_autoassociate(), net80211_step_associate(), trivial_init(), wpa_handle_3_of_4(), wpa_make_rsn_ie(), and wpa_start().

Definition at line 874 of file net80211.h.

Referenced by net80211_autoassociate(), and net80211_step_associate().

Definition at line 875 of file net80211.h.

Referenced by net80211_autoassociate(), and net80211_step_associate().

union { ... } net80211_device::ctx

Context for the association process.

This is a probe_ctx if the PROBED flag is not set in state, and an assoc_ctx otherwise.

Referenced by net80211_autoassociate(), and net80211_step_associate().

State of our association to the network.

Since the association process happens asynchronously, it's necessary to have some channel of communication so the driver can say "I got an association reply and we're OK" or similar. This variable provides that link. It is a bitmask of any of NET80211_PROBED, NET80211_AUTHENTICATED, NET80211_ASSOCIATED, NET80211_CRYPTO_SYNCED to indicate how far along in associating we are; NET80211_WORKING if the association task is running; and NET80211_WAITING if a packet has been sent that we're waiting for a reply to. We can only be crypto-synced if we're associated, we can only be associated if we're authenticated, we can only be authenticated if we've probed.

If an association process fails (that is, we receive a packet with an error indication), the error code is copied into bits 6-0 of this variable and bit 7 is set to specify what type of error code it is. An AP can provide either a "status code" (0-51 are defined) explaining why it refused an association immediately, or a "reason code" (0-45 are defined) explaining why it canceled an association after it had originally OK'ed it. Status and reason codes serve similar functions, but they use separate error message tables. A iPXE-formatted return status code (negative) is placed in assoc_rc.

If the failure to associate is indicated by a status code, the NET80211_IS_REASON bit will be clear; if it is indicated by a reason code, the bit will be set. If we were successful, both zero status and zero reason mean success, so there is no ambiguity.

To prevent association when opening the device, user code can set the NET80211_NO_ASSOC bit. The final bit in this variable, NET80211_AUTO_SSID, is used to remember whether we picked our SSID through automated probing as opposed to user specification; the distinction becomes relevant in the settings applicator.

Definition at line 921 of file net80211.h.

Referenced by ath5k_config(), ath9k_bss_iter(), ath9k_config_bss(), iwlist(), iwstat(), net80211_autoassociate(), net80211_check_settings_update(), net80211_handle_mgmt(), net80211_ll_push(), net80211_netdev_close(), net80211_netdev_open(), net80211_rx(), net80211_send_disassoc(), net80211_set_state(), net80211_step_associate(), net80211_update_link_quality(), and rtl818x_config().

Return status code associated with state.

Definition at line 924 of file net80211.h.

Referenced by net80211_autoassociate(), net80211_deauthenticate(), net80211_ll_push(), net80211_set_state(), and net80211_step_associate().

RSN or WPA information element to include with association.

If set to NULL, none will be included. It is expected that this will be set by the init function of a security handshaker if it is needed.

Definition at line 932 of file net80211.h.

Referenced by net80211_marshal_request_info(), net80211_prepare_assoc(), wpa_psk_init(), wpa_send_2_of_4(), and wpa_start().

802.11 cryptosystem for our current network

For an open network, this will be set to NULL.

Definition at line 940 of file net80211.h.

Referenced by ath_tx_setup_buffer(), net80211_handle_auth(), net80211_netdev_close(), net80211_netdev_transmit(), net80211_prepare_assoc(), net80211_rx(), net80211_tx_mgmt(), trivial_change_key(), trivial_init(), and wpa_install_ptk().

802.11 cryptosystem for multicast and broadcast frames

If this is NULL, the cryptosystem used for receiving unicast frames will also be used for receiving multicast and broadcast frames. Transmitted multicast and broadcast frames are always sent unicast to the AP, who multicasts them on our behalf; thus they always use the unicast cryptosystem.

Definition at line 951 of file net80211.h.

Referenced by net80211_prepare_assoc(), net80211_rx(), and wpa_install_gtk().

SSID of the access point we are or will be associated with.

Although the SSID field in 802.11 packets is generally not NUL-terminated, here and in net80211_wlan we add a NUL for convenience.

Definition at line 962 of file net80211.h.

Referenced by iwstat(), net80211_autoassociate(), net80211_check_settings_update(), net80211_marshal_request_info(), net80211_prepare_assoc(), net80211_probe_start(), net80211_process_ie(), net80211_step_associate(), and wpa_psk_start().

Association ID given to us by the AP.

Definition at line 965 of file net80211.h.

Referenced by ath9k_bss_iter(), and net80211_handle_assoc_reply().

TSFT value for last beacon received, microseconds.

Definition at line 968 of file net80211.h.

Referenced by net80211_prepare_assoc(), and net80211_update_link_quality().

Time between AP sending beacons, microseconds.

Definition at line 971 of file net80211.h.

Referenced by iwstat(), and net80211_prepare_assoc().

Smoothed average time between beacons, microseconds.

Definition at line 974 of file net80211.h.

Referenced by iwstat(), and net80211_update_link_quality().

Physical layer options.

These control the use of CTS protection, short preambles, and short-slot operation.

Definition at line 983 of file net80211.h.

Referenced by ath5k_config(), ath5k_txbuf_setup(), ath9k_bss_info_changed(), net80211_duration(), net80211_process_capab(), net80211_process_ie(), rtl818x_tx(), and rtl8225_rf_conf_erp().

Signal strength of last received packet.

Definition at line 986 of file net80211.h.

Referenced by iwstat(), and net80211_rx().

Fragment reassembly state.

Definition at line 994 of file net80211.h.

Referenced by net80211_accum_frags(), net80211_free_frags(), and net80211_rx_frag().

The sequence number of the last packet we sent.

Definition at line 997 of file net80211.h.

Referenced by net80211_ll_push(), and net80211_tx_mgmt().

Packet duplication elimination state.

We are only required to handle immediate duplicates for each direct sender, and since we can only have one direct sender (the AP), we need only keep the sequence control field from the most recent packet we've received. Thus, this field stores the last sequence control field we've received for a packet from the AP.

Definition at line 1008 of file net80211.h.

Referenced by net80211_rx().

RX management packet queue.

Sometimes we want to keep probe, beacon, and action packets that we receive, such as when we're scanning for networks. Ordinarily we drop them because they are sent at a large volume (ten beacons per second per AP, broadcast) and we have no need of them except when we're scanning.

When keep_mgmt is TRUE, received probe, beacon, and action management packets will be stored in this queue.

Definition at line 1021 of file net80211.h.

Referenced by net80211_alloc(), net80211_handle_mgmt(), and net80211_mgmt_dequeue().

RX management packet info queue.

We need to keep track of the signal strength for management packets we're keeping, because that provides the only way to distinguish between multiple APs for the same network. Since we can't extend io_buffer to store signal, this field heads a linked list of "RX packet info" structures that contain that signal strength field. Its entries always parallel the entries in mgmt_queue, because the two queues are always added to or removed from in parallel.

Definition at line 1034 of file net80211.h.

Referenced by net80211_alloc(), net80211_handle_mgmt(), and net80211_mgmt_dequeue().

Whether to store management packets.

Received beacon, probe, and action packets will be added to mgmt_queue (and their signal strengths added to mgmt_info_queue) only when this variable is TRUE. It should be set by net80211_keep_mgmt() (which returns the old value) only when calling code is prepared to poll the management queue frequently, because packets will otherwise pile up and exhaust memory.

Definition at line 1046 of file net80211.h.

Referenced by net80211_handle_mgmt(), and net80211_keep_mgmt().


The documentation for this struct was generated from the following file: