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

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

◆ netdev

struct net_device* net80211_device::netdev

◆ list

struct list_head net80211_device::list

List of 802.11 devices.

Definition at line 792 of file net80211.h.

Referenced by net80211_check_settings_update(), and net80211_get().

◆ op

struct net80211_device_operations* net80211_device::op

◆ priv

void* net80211_device::priv

◆ hw

struct net80211_hw_info* net80211_device::hw

◆ channels

struct net80211_channel net80211_device::channels[NET80211_MAX_CHANNELS]

◆ nr_channels

u8 net80211_device::nr_channels

The number of channels in the channels array.

Definition at line 809 of file net80211.h.

Referenced by iwstat(), net80211_change_channel(), net80211_filter_hw_channels(), net80211_prepare_probe(), net80211_probe_start(), net80211_probe_step(), and net80211_process_ie().

◆ channel

u8 net80211_device::channel

◆ rates

u16 net80211_device::rates[NET80211_MAX_RATES]

◆ nr_rates

u8 net80211_device::nr_rates

◆ rate

u8 net80211_device::rate

◆ rtscts_rate

u8 net80211_device::rtscts_rate

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().

◆ basic_rates

u32 net80211_device::basic_rates

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().

◆ proc_assoc

struct process net80211_device::proc_assoc

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_autoassociate(), net80211_netdev_close(), and net80211_step_associate().

◆ associating

struct net80211_wlan* net80211_device::associating

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_make_rsn_ie(), and wpa_start().

◆ probe

struct net80211_probe_ctx* net80211_device::probe

Definition at line 874 of file net80211.h.

Referenced by net80211_autoassociate(), and net80211_step_associate().

◆ assoc

struct net80211_assoc_ctx* net80211_device::assoc

Definition at line 875 of file net80211.h.

Referenced by net80211_autoassociate(), and net80211_step_associate().

◆ ctx

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().

◆ handshaker

struct net80211_handshaker* net80211_device::handshaker

◆ state

u16 net80211_device::state

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_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_step_associate(), net80211_update_link_quality(), and rtl818x_config().

◆ assoc_rc

int net80211_device::assoc_rc

Return status code associated with state.

Definition at line 924 of file net80211.h.

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

◆ rsn_ie

union ieee80211_ie* net80211_device::rsn_ie

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(), and wpa_start().

◆ crypto

struct net80211_crypto* net80211_device::crypto

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(), and trivial_init().

◆ gcrypto

struct net80211_crypto* net80211_device::gcrypto

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(), and net80211_rx().

◆ bssid

u8 net80211_device::bssid[ETH_ALEN]

◆ essid

char net80211_device::essid[IEEE80211_MAX_SSID_LEN+1]

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().

◆ aid

u16 net80211_device::aid

Association ID given to us by the AP.

Definition at line 965 of file net80211.h.

Referenced by net80211_handle_assoc_reply().

◆ last_beacon_timestamp

u64 net80211_device::last_beacon_timestamp

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().

◆ tx_beacon_interval

u32 net80211_device::tx_beacon_interval

Time between AP sending beacons, microseconds.

Definition at line 971 of file net80211.h.

Referenced by iwstat(), and net80211_prepare_assoc().

◆ rx_beacon_interval

u32 net80211_device::rx_beacon_interval

Smoothed average time between beacons, microseconds.

Definition at line 974 of file net80211.h.

Referenced by iwstat(), and net80211_update_link_quality().

◆ phy_flags

int net80211_device::phy_flags

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().

◆ last_signal

int net80211_device::last_signal

Signal strength of last received packet.

Definition at line 986 of file net80211.h.

Referenced by iwstat(), and net80211_rx().

◆ rctl

struct rc80211_ctx* net80211_device::rctl

◆ frags

struct net80211_frag_cache net80211_device::frags[NET80211_NR_CONCURRENT_FRAGS]

Fragment reassembly state.

Definition at line 994 of file net80211.h.

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

◆ last_tx_seqnr

u16 net80211_device::last_tx_seqnr

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().

◆ last_rx_seq

u16 net80211_device::last_rx_seq

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().

◆ mgmt_queue

struct list_head net80211_device::mgmt_queue

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_handle_mgmt(), and net80211_mgmt_dequeue().

◆ mgmt_info_queue

struct list_head net80211_device::mgmt_info_queue

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_handle_mgmt(), and net80211_mgmt_dequeue().

◆ keep_mgmt

int net80211_device::keep_mgmt

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: