1#ifndef _IPXE_NET80211_H
2#define _IPXE_NET80211_H
45#define NET80211_BAND_2GHZ 0
47#define NET80211_BAND_5GHZ 1
49#define NET80211_NR_BANDS 2
52#define NET80211_BAND_BIT_2GHZ (1 << 0)
54#define NET80211_BAND_BIT_5GHZ (1 << 1)
63#define NET80211_MODE_A (1 << 0)
66#define NET80211_MODE_B (1 << 1)
69#define NET80211_MODE_G (1 << 2)
72#define NET80211_MODE_N (1 << 3)
81#define NET80211_CFG_CHANNEL (1 << 0)
84#define NET80211_CFG_RATE (1 << 1)
87#define NET80211_CFG_ASSOC (1 << 2)
90#define NET80211_CFG_PHY_PARAMS (1 << 3)
185#define NET80211_STATUS_MASK 0x7F
188#define NET80211_IS_REASON 0x80
191#define NET80211_PROBED (1 << 8)
198#define NET80211_AUTHENTICATED (1 << 9)
201#define NET80211_ASSOCIATED (1 << 10)
209#define NET80211_CRYPTO_SYNCED (1 << 11)
212#define NET80211_WORKING (1 << 12)
215#define NET80211_WAITING (1 << 13)
223#define NET80211_NO_ASSOC (1 << 14)
234#define NET80211_AUTO_SSID (1 << 15)
251#define NET80211_PHY_USE_PROTECTION (1 << 1)
260#define NET80211_PHY_USE_SHORT_PREAMBLE (1 << 2)
266#define NET80211_PHY_USE_SHORT_SLOT (1 << 3)
272#define NET80211_MAX_RATES 16
275#define NET80211_MAX_CHANNELS 40
278#define NET80211_FRAG_TIMEOUT 2
284#define NET80211_NR_CONCURRENT_FRAGS 3
287#define NET80211_REG_TXPOWER 20
675#define NET80211_HANDSHAKERS __table ( struct net80211_handshaker, \
676 "net80211_handshakers" )
677#define __net80211_handshaker __table_entry ( NET80211_HANDSHAKERS, 01 )
708 int keylen,
const void *
rsc );
769#define NET80211_CRYPTOS __table ( struct net80211_crypto, "net80211_cryptos" )
770#define __net80211_crypto __table_entry ( NET80211_CRYPTOS, 01 )
union @162305117151260234136356364136041353210355154177 key
Sense key.
struct golan_eq_context ctx
struct arbelprm_rc_send_wqe rc
static struct net_device * netdev
#define IEEE80211_MAX_SSID_LEN
Maximum length of an ESSID.
uint16_t size
Buffer size.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
int net80211_prepare_assoc(struct net80211_device *dev, struct net80211_wlan *wlan)
Prepare 802.11 device channel and rate set for communication.
int net80211_send_auth(struct net80211_device *dev, struct net80211_wlan *wlan, int method)
Send 802.11 initial authentication frame.
int net80211_send_assoc(struct net80211_device *dev, struct net80211_wlan *wlan)
Send 802.11 association frame.
void net80211_deauthenticate(struct net80211_device *dev, int rc)
Deauthenticate from current network and try again.
#define NET80211_NR_BANDS
Number of RF bands.
struct net80211_device * net80211_alloc(size_t priv_size)
Allocate 802.11 device.
void net80211_tx_complete(struct net80211_device *dev, struct io_buffer *iob, int retries, int rc)
Indicate the completed transmission of a packet.
int net80211_register(struct net80211_device *dev, struct net80211_device_operations *ops, struct net80211_hw_info *hw)
Register 802.11 device with network stack.
void net80211_unregister(struct net80211_device *dev)
Unregister 802.11 device from network stack.
void net80211_rx_err(struct net80211_device *dev, struct io_buffer *iob, int rc)
Indicate an error in receiving a packet.
u16 net80211_duration(struct net80211_device *dev, int bytes, u16 rate)
Calculate one frame's contribution to 802.11 duration field.
void net80211_free(struct net80211_device *dev)
Free 802.11 device.
void net80211_rx(struct net80211_device *dev, struct io_buffer *iob, int signal, u16 rate)
Handle receipt of 802.11 frame.
int net80211_tx_mgmt(struct net80211_device *dev, u16 fc, u8 bssid[ETH_ALEN], struct io_buffer *iob)
struct net80211_device * net80211_get(struct net_device *netdev)
Get 802.11 device from wrapping network device.
void net80211_set_rate_idx(struct net80211_device *dev, int rate)
Set data transmission rate for 802.11 device.
int net80211_change_channel(struct net80211_device *dev, int channel)
Configure 802.11 device to transmit on a certain channel.
void net80211_autoassociate(struct net80211_device *dev)
Start 802.11 association process.
int net80211_keep_mgmt(struct net80211_device *dev, int enable)
Set state of 802.11 device keeping management frames.
struct io_buffer * net80211_mgmt_dequeue(struct net80211_device *dev, int *signal)
Get 802.11 management frame.
void net80211_free_wlanlist(struct list_head *list)
Free list of WLAN structures.
struct net80211_wlan * net80211_probe_finish_best(struct net80211_probe_ctx *ctx)
Finish probe of 802.11 networks, returning best-signal network found.
void net80211_free_wlan(struct net80211_wlan *wlan)
Free WLAN structure.
struct list_head * net80211_probe_finish_all(struct net80211_probe_ctx *ctx)
Finish probe of 802.11 networks, returning all networks found.
int net80211_prepare_probe(struct net80211_device *dev, int band, int active)
Prepare 802.11 device channel and rate set for scanning.
struct net80211_probe_ctx * net80211_probe_start(struct net80211_device *dev, const char *essid, int active)
Begin probe of 802.11 networks.
int net80211_probe_step(struct net80211_probe_ctx *ctx)
Continue probe of 802.11 networks.
#define SETTING_NETDEV_EXTRA
Network device additional settings.
Constants and data structures defined in IEEE 802.11, subsetted according to what iPXE knows how to u...
u16 fc
802.11 Frame Control field
#define __setting(setting_order, name)
Declare a configuration setting.
net80211_security_proto
An 802.11 security handshaking protocol.
@ NET80211_SECPROT_UNKNOWN
Dummy value used when the handshaking type can't be detected.
@ NET80211_SECPROT_NONE
No security handshaking.
@ NET80211_SECPROT_PSK
Pre-shared key handshaking.
@ NET80211_SECPROT_EAP
Full EAP 802.1X handshaking.
net80211_crypto_alg
An 802.11 data encryption algorithm.
@ NET80211_CRYPT_NONE
No security, an "Open" network.
@ NET80211_CRYPT_CCMP
Network protected with CCMP (AES-based system)
@ NET80211_CRYPT_TKIP
Network protected with TKIP (better RC4-based system)
@ NET80211_CRYPT_UNKNOWN
Dummy value used when the cryptosystem can't be detected.
@ NET80211_CRYPT_WEP
Network protected with WEP (awful RC4-based system)
#define NET80211_MAX_CHANNELS
The maximum number of channels we allow to be configured simultaneously.
#define NET80211_NR_CONCURRENT_FRAGS
The number of fragments we can receive at once.
#define NET80211_MAX_RATES
The maximum number of TX rates we allow to be configured simultaneously.
static u16 net80211_cts_duration(struct net80211_device *dev, int size)
Calculate duration field for a CTS control frame.
Network device management.
uint32_t channel
RNDIS channel.
Rate-control algorithm prototype for 802.11.
A doubly-linked list entry (or list head)
Context for the association task.
u16 hw_value
Hardware channel value.
u8 maxpower
Maximum allowable transmit power, in dBm.
u16 center_freq
The center frequency for this channel.
u8 band
The band with which this channel is associated.
u8 channel_nr
A channel number interpreted according to the band.
Interface to an 802.11 cryptosystem.
void * priv
Private data for the algorithm to store key and state info.
enum net80211_crypto_alg algorithm
The cryptographic algorithm implemented.
int(* init)(struct net80211_crypto *crypto, const void *key, int keylen, const void *rsc)
Initialize cryptosystem using a given key.
int priv_len
Length of private data requested to be allocated.
Operations that must be implemented by an 802.11 driver.
void(* poll)(struct net80211_device *dev)
Poll for completed and received packets.
int(* transmit)(struct net80211_device *dev, struct io_buffer *iobuf)
Transmit packet on 802.11 network device.
void(* irq)(struct net80211_device *dev, int enable)
Enable or disable interrupts.
void(* close)(struct net80211_device *dev)
Close 802.11 network device.
int(* config)(struct net80211_device *dev, int changed)
Update hardware state to match 802.11 layer state.
int(* open)(struct net80211_device *dev)
Open 802.11 device.
Structure encapsulating the complete state of an 802.11 device.
struct net_device * netdev
The net_device that wraps us.
u16 last_tx_seqnr
The sequence number of the last packet we sent.
u16 rates[NET80211_MAX_RATES]
A list of all possible TX rates we might use.
struct net80211_channel channels[NET80211_MAX_CHANNELS]
A list of all possible channels we might use.
char essid[IEEE80211_MAX_SSID_LEN+1]
SSID of the access point we are or will be associated with.
struct net80211_device_operations * op
802.11 device operations
int assoc_rc
Return status code associated with state.
u32 tx_beacon_interval
Time between AP sending beacons, microseconds.
void * priv
Driver private data.
u64 last_beacon_timestamp
TSFT value for last beacon received, microseconds.
u8 rtscts_rate
The rate to use for RTS/CTS transmissions.
int keep_mgmt
Whether to store management packets.
struct list_head mgmt_queue
RX management packet queue.
union ieee80211_ie * rsn_ie
RSN or WPA information element to include with association.
u16 state
State of our association to the network.
struct net80211_crypto * crypto
802.11 cryptosystem for our current network
int last_signal
Signal strength of last received packet.
struct list_head mgmt_info_queue
RX management packet info queue.
struct rc80211_ctx * rctl
Rate control state.
u8 channel
The channel currently in use, as an index into the channels array.
u32 rx_beacon_interval
Smoothed average time between beacons, microseconds.
struct net80211_handshaker * handshaker
Security handshaker being used.
int phy_flags
Physical layer options.
u16 aid
Association ID given to us by the AP.
struct net80211_wlan * associating
Network with which we are associating.
struct net80211_crypto * gcrypto
802.11 cryptosystem for multicast and broadcast frames
struct list_head list
List of 802.11 devices.
u8 bssid[ETH_ALEN]
MAC address of the access point most recently associated.
struct net80211_assoc_ctx * assoc
u8 nr_channels
The number of channels in the channels array.
struct net80211_probe_ctx * probe
u8 rate
The rate currently in use, as an index into the rates array.
struct process proc_assoc
The asynchronous association process.
struct net80211_hw_info * hw
Information about the hardware, provided to net80211_register()
u32 basic_rates
Bitmask of basic rates.
struct net80211_frag_cache frags[NET80211_NR_CONCURRENT_FRAGS]
Fragment reassembly state.
u16 last_rx_seq
Packet duplication elimination state.
u8 nr_rates
The number of transmission rates in the rates array.
Structure tracking received fragments for a packet.
u32 start_ticks
Timestamp from point at which first fragment was collected.
u8 in_use
Whether this cache entry is in use.
u16 seqnr
Sequence number of this MSDU (packet)
struct io_buffer * iob[16]
Buffers for each fragment.
Interface to an 802.11 security handshaking protocol.
int(* init)(struct net80211_device *dev)
Initialize security handshaking protocol.
int started
Whether start has been called.
int(* start)(struct net80211_device *dev)
Start handshaking.
int priv_len
Amount of private data requested.
int(* change_key)(struct net80211_device *dev)
Change cryptographic key based on setting.
void * priv
Pointer to private data.
int(* step)(struct net80211_device *dev)
Process handshaking state.
void(* stop)(struct net80211_device *dev)
Stop security handshaking handlers.
enum net80211_security_proto protocol
The security handshaking protocol implemented.
Information on the capabilities of an 802.11 hardware device.
int modes
A bitwise OR of the 802.11x modes supported by this device.
int nr_rates[NET80211_NR_BANDS]
Number of supported rates, indexed by band.
int bands
A bitwise OR of the bands on which this device can communicate.
unsigned channel_change_time
Estimate of the time required to change channels, in microseconds.
struct net80211_channel channels[NET80211_MAX_CHANNELS]
List of RF channels supported by the card.
u8 hwaddr[ETH_ALEN]
Default hardware MAC address.
@ NET80211_SIGNAL_ARBITRARY
Signal strength in arbitrary units.
@ NET80211_SIGNAL_DBM
Signal strength in decibels relative to 1mW.
@ NET80211_SIGNAL_DB
Signal strength in decibels relative to arbitrary base.
@ NET80211_SIGNAL_NONE
No signal strength information supported.
unsigned signal_max
Maximum signal in arbitrary cases.
int nr_channels
Number of supported channels.
@ NET80211_HW_NO_SHORT_SLOT
Hardware doesn't support 802.11g short slot operation.
@ NET80211_HW_NO_SHORT_PREAMBLE
Hardware doesn't support 2.4GHz short preambles.
@ NET80211_HW_RX_HAS_FCS
Received frames include a frame check sequence.
enum net80211_hw_info::@160150106134320172247032061203111226300065160315 signal_type
Signal strength information that can be provided by the device.
u16 rates[NET80211_NR_BANDS][NET80211_MAX_RATES]
List of transmission rates supported by the card, indexed by band.
Context for a probe operation.
const char * essid
If non-"", the ESSID to limit ourselves to.
struct net80211_device * dev
802.11 device to probe on
Structure representing a probed network.
struct list_head list
Link to allow chaining multiple structures into a list to be returned from net80211_probe_finish_all(...
struct io_buffer * beacon
The complete beacon or probe-response frame received.
u8 bssid[ETH_ALEN]
MAC address of the strongest-signal access point for this ESSID.
char essid[IEEE80211_MAX_SSID_LEN+1]
The human-readable ESSID (network name)
int channel
The channel on which that access point communicates.
enum net80211_crypto_alg crypto
Cryptographic algorithm used on the network.
int signal
Signal strength of beacon frame from that access point.
enum net80211_security_proto handshaking
Security handshaking method used on the network.
Any 802.11 information element.
u8 rsc[8]
Receive sequence counter for GTK.