iPXE
|
Structure encapsulating the complete state of an 802.11 device. More...
#include <net80211.h>
Data Fields | |
struct net_device * | netdev |
The net_device that wraps us. More... | |
struct list_head | list |
List of 802.11 devices. More... | |
struct net80211_device_operations * | op |
802.11 device operations More... | |
void * | priv |
Driver private data. More... | |
struct net80211_hw_info * | hw |
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_wlan * | associating |
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_handshaker * | handshaker |
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_ie * | rsn_ie |
RSN or WPA information element to include with association. More... | |
struct net80211_crypto * | crypto |
802.11 cryptosystem for our current network More... | |
struct net80211_crypto * | gcrypto |
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_ctx * | rctl |
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... | |
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.
struct net_device* net80211_device::netdev |
The net_device that wraps us.
Definition at line 789 of file net80211.h.
Referenced by ath5k_probe(), ath5k_start(), ath_pci_probe(), iwlist(), iwstat(), net80211_autoassociate(), net80211_change_channel(), net80211_check_settings_update(), net80211_deauthenticate(), net80211_handle_auth(), net80211_prepare_assoc(), net80211_prepare_probe(), net80211_probe_start(), net80211_rx(), net80211_rx_err(), net80211_set_rate_idx(), net80211_step_associate(), net80211_tx_complete(), net80211_tx_mgmt(), rtl818x_init_hw(), rtl818x_init_rx_ring(), rtl818x_init_tx_ring(), rtl818x_probe(), rtl818x_start(), trivial_change_key(), trivial_init(), and wpa_psk_start().
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().
struct net80211_device_operations* net80211_device::op |
802.11 device operations
Definition at line 795 of file net80211.h.
Referenced by net80211_change_channel(), net80211_filter_hw_channels(), net80211_netdev_close(), net80211_netdev_irq(), net80211_netdev_open(), net80211_netdev_poll(), net80211_netdev_transmit(), net80211_prepare_assoc(), net80211_prepare_probe(), net80211_probe_start(), net80211_probe_step(), net80211_process_capab(), net80211_process_ie(), and net80211_set_rate_idx().
void* net80211_device::priv |
Driver private data.
Definition at line 798 of file net80211.h.
Referenced by ath5k_attach(), ath5k_config(), ath5k_detach(), ath5k_irq(), ath5k_poll(), ath5k_probe(), ath5k_remove(), ath5k_setup_bands(), ath5k_start(), ath5k_stop(), ath5k_tx(), ath9k_bss_info_changed(), ath9k_config(), ath9k_irq(), ath9k_process_rate(), ath9k_start(), ath9k_stop(), ath9k_tx(), ath_isr(), ath_pci_probe(), ath_pci_remove(), ath_tx_setup_buffer(), ath_tx_start(), grf5101_rf_init(), grf5101_rf_set_channel(), grf5101_rf_stop(), grf5101_write_phy_antenna(), max2820_rf_init(), max2820_rf_set_channel(), max2820_write_phy_antenna(), rtl818x_config(), rtl818x_free_rx_ring(), rtl818x_free_tx_ring(), rtl818x_handle_rx(), rtl818x_handle_tx(), rtl818x_init_hw(), rtl818x_init_rx_ring(), rtl818x_init_tx_ring(), rtl818x_irq(), rtl818x_poll(), rtl818x_probe(), rtl818x_set_hwaddr(), rtl818x_start(), rtl818x_stop(), rtl818x_tx(), rtl818x_write_phy(), rtl8225_read(), rtl8225_rf_conf_erp(), rtl8225_rf_init(), rtl8225_rf_set_channel(), rtl8225_rf_set_tx_power(), rtl8225_rf_stop(), rtl8225_write(), rtl8225x_rf_init(), rtl8225z2_rf_init(), rtl8225z2_rf_set_tx_power(), sa2400_rf_init(), sa2400_rf_set_channel(), sa2400_write_phy_antenna(), write_grf5101(), write_max2820(), and write_sa2400().
struct net80211_hw_info* net80211_device::hw |
Information about the hardware, provided to net80211_register()
Definition at line 801 of file net80211.h.
Referenced by iwlist(), iwstat(), net80211_filter_hw_channels(), net80211_prepare_probe(), net80211_probe_step(), net80211_process_ie(), net80211_rx(), net80211_send_assoc(), and net80211_step_associate().
struct net80211_channel net80211_device::channels[NET80211_MAX_CHANNELS] |
A list of all possible channels we might use.
Definition at line 806 of file net80211.h.
Referenced by ath5k_config(), ath5k_init(), ath9k_bss_info_changed(), ath9k_cmn_get_curchannel(), ath9k_config(), ath9k_hw_set_clockrate(), ath9k_process_rate(), ath9k_start(), ath_buf_set_rate(), ath_radio_disable(), ath_set_channel(), iwlist(), iwstat(), net80211_change_channel(), net80211_duration(), net80211_filter_hw_channels(), net80211_prepare_probe(), net80211_probe_step(), net80211_process_ie(), and rtl818x_config().
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().
u8 net80211_device::channel |
The channel currently in use, as an index into the channels array.
Definition at line 812 of file net80211.h.
Referenced by ath5k_config(), ath5k_init(), ath9k_bss_info_changed(), ath9k_cmn_get_curchannel(), ath9k_config(), ath9k_hw_set_clockrate(), ath9k_process_rate(), ath9k_start(), ath_buf_set_rate(), ath_radio_disable(), ath_set_channel(), iwlist(), iwstat(), net80211_change_channel(), net80211_duration(), net80211_filter_hw_channels(), net80211_prepare_probe(), net80211_probe_start(), net80211_probe_step(), net80211_process_ie(), and rtl818x_config().
u16 net80211_device::rates[NET80211_MAX_RATES] |
A list of all possible TX rates we might use.
Rates are in units of 100 kbps.
Definition at line 818 of file net80211.h.
Referenced by ath5k_config(), ath9k_config(), iwstat(), net80211_cts_duration(), net80211_ll_push(), net80211_marshal_request_info(), net80211_prepare_probe(), net80211_process_ie(), net80211_set_rate_idx(), net80211_set_rtscts_rate(), net80211_tx_mgmt(), rc80211_set_rate(), rc80211_update_rx(), rc80211_update_tx(), rtl818x_config(), and rtl818x_tx().
u8 net80211_device::nr_rates |
The number of transmission rates in the rates array.
Definition at line 821 of file net80211.h.
Referenced by iwstat(), net80211_marshal_request_info(), net80211_prepare_probe(), net80211_process_ie(), net80211_set_rate_idx(), net80211_set_rtscts_rate(), rc80211_maybe_set_new(), rc80211_pick_best(), and rc80211_update_rx().
u8 net80211_device::rate |
The rate currently in use, as an index into the rates array.
Definition at line 824 of file net80211.h.
Referenced by ath5k_config(), ath9k_config(), iwstat(), net80211_cts_duration(), net80211_ll_push(), net80211_prepare_assoc(), net80211_prepare_probe(), net80211_process_ie(), net80211_set_rate_idx(), net80211_set_rtscts_rate(), net80211_tx_mgmt(), rc80211_maybe_set_new(), rc80211_pick_best(), rc80211_set_rate(), rc80211_update_tx(), rtl818x_config(), and rtl818x_tx().
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().
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().
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().
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().
struct net80211_probe_ctx* net80211_device::probe |
Definition at line 874 of file net80211.h.
Referenced by net80211_autoassociate(), and net80211_step_associate().
struct net80211_assoc_ctx* net80211_device::assoc |
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().
struct net80211_handshaker* net80211_device::handshaker |
Security handshaker being used.
Definition at line 879 of file net80211.h.
Referenced by net80211_check_settings_update(), net80211_netdev_close(), net80211_prepare_assoc(), net80211_step_associate(), wpa_psk_start(), and wpa_psk_step().
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().
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().
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().
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().
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().
MAC address of the access point most recently associated.
Definition at line 954 of file net80211.h.
Referenced by ath5k_config(), eapol_key_rx(), net80211_handle_assoc_reply(), net80211_ll_push(), net80211_prepare_assoc(), net80211_rx(), net80211_send_disassoc(), net80211_step_associate(), and rtl818x_config().
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().
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().
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().
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().
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().
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().
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().
struct rc80211_ctx* net80211_device::rctl |
Rate control state.
Definition at line 989 of file net80211.h.
Referenced by net80211_rx(), net80211_step_associate(), net80211_tx_complete(), rc80211_maybe_set_new(), rc80211_pick_best(), rc80211_set_rate(), rc80211_update(), and rc80211_update_tx().
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().
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().
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().
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().
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().
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().