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 ) struct net80211_frag_cache frags[NET80211_NR_CONCURRENT_FRAGS]
Fragment reassembly state.
struct arbelprm_rc_send_wqe rc
Network protected with CCMP (AES-based system)
Structure representing a probed network.
int modes
A bitwise OR of the 802.11x modes supported by this device.
void net80211_free(struct net80211_device *dev)
Free 802.11 device.
struct net80211_channel channels[NET80211_MAX_CHANNELS]
List of RF channels supported by the card.
enum net80211_crypto_alg crypto
Cryptographic algorithm used on the network.
struct net80211_probe_ctx * probe
u64 last_beacon_timestamp
TSFT value for last beacon received, microseconds.
struct net80211_probe_ctx * net80211_probe_start(struct net80211_device *dev, const char *essid, int active)
Begin probe of 802.11 networks.
u8 channel
The channel currently in use, as an index into the channels array.
int(* config)(struct net80211_device *dev, int changed)
Update hardware state to match 802.11 layer state.
Context for the association task.
u8 in_use
Whether this cache entry is in use.
Dummy value used when the cryptosystem can't be detected.
u32 basic_rates
Bitmask of basic rates.
int priv_len
Amount of private data requested.
char essid[IEEE80211_MAX_SSID_LEN+1]
The human-readable ESSID (network name)
void net80211_rx_err(struct net80211_device *dev, struct io_buffer *iob, int rc)
Indicate an error in receiving a packet.
u16 fc
802.11 Frame Control field
void(* poll)(struct net80211_device *dev)
Poll for completed and received packets.
void net80211_rx(struct net80211_device *dev, struct io_buffer *iob, int signal, u16 rate)
Handle receipt of 802.11 frame.
u8 rtscts_rate
The rate to use for RTS/CTS transmissions.
uint8_t size
Entry size (in 32-bit words)
void net80211_unregister(struct net80211_device *dev)
Unregister 802.11 device from network stack.
Constants and data structures defined in IEEE 802.11, subsetted according to what iPXE knows how to u...
struct list_head mgmt_info_queue
RX management packet info queue.
enum net80211_security_proto handshaking
Security handshaking method used on the network.
net80211_security_proto
An 802.11 security handshaking protocol.
No signal strength information supported.
Full EAP 802.1X handshaking.
u16 net80211_duration(struct net80211_device *dev, int bytes, u16 rate)
Calculate one frame's contribution to 802.11 duration field.
union ieee80211_ie * rsn_ie
RSN or WPA information element to include with association.
u16 aid
Association ID given to us by the AP.
unsigned signal_max
Maximum signal in arbitrary cases.
Signal strength in decibels relative to arbitrary base.
struct list_head list
List of 802.11 devices.
struct golan_eq_context ctx
Structure tracking received fragments for a packet.
Network protected with WEP (awful RC4-based system)
int(* init)(struct net80211_crypto *crypto, const void *key, int keylen, const void *rsc)
Initialize cryptosystem using a given key.
void net80211_deauthenticate(struct net80211_device *dev, int rc)
Deauthenticate from current network and try again.
struct list_head mgmt_queue
RX management packet queue.
enum net80211_hw_info::@630 signal_type
Signal strength information that can be provided by the device.
int priv_len
Length of private data requested to be allocated.
Dummy value used when the handshaking type can't be detected.
Context for a probe operation.
char essid[IEEE80211_MAX_SSID_LEN+1]
SSID of the access point we are or will be associated with.
const char * essid
If non-"", the ESSID to limit ourselves to.
A doubly-linked list entry (or list head)
int(* open)(struct net80211_device *dev)
Open 802.11 device.
u32 tx_beacon_interval
Time between AP sending beacons, microseconds.
u16 rates[NET80211_NR_BANDS][NET80211_MAX_RATES]
List of transmission rates supported by the card, indexed by band.
Operations that must be implemented by an 802.11 driver.
void net80211_set_rate_idx(struct net80211_device *dev, int rate)
Set data transmission rate for 802.11 device.
enum net80211_crypto_alg algorithm
The cryptographic algorithm implemented.
void * priv
Pointer to private data.
#define NET80211_NR_BANDS
Number of RF bands.
int started
Whether start has been called.
int(* init)(struct net80211_device *dev)
Initialize security handshaking protocol.
u16 hw_value
Hardware channel value.
struct net80211_crypto * crypto
802.11 cryptosystem for our current network
Pre-shared key handshaking.
Information on the capabilities of an 802.11 hardware device.
u8 hwaddr[ETH_ALEN]
Default hardware MAC address.
u8 maxpower
Maximum allowable transmit power, in dBm.
struct process proc_assoc
The asynchronous association process.
u8 nr_channels
The number of channels in the channels array.
struct rc80211_ctx * rctl
Rate control state.
struct io_buffer * net80211_mgmt_dequeue(struct net80211_device *dev, int *signal)
Get 802.11 management frame.
int nr_rates[NET80211_NR_BANDS]
Number of supported rates, indexed by band.
void(* stop)(struct net80211_device *dev)
Stop security handshaking handlers.
#define SETTING_NETDEV_EXTRA
Network device additional settings.
int last_signal
Signal strength of last received packet.
struct net80211_crypto * gcrypto
802.11 cryptosystem for multicast and broadcast frames
u8 rsc[8]
Receive sequence counter for GTK.
int keep_mgmt
Whether to store management packets.
enum net80211_security_proto protocol
The security handshaking protocol implemented.
static struct net_device * netdev
void(* irq)(struct net80211_device *dev, int enable)
Enable or disable interrupts.
FILE_LICENCE(GPL2_OR_LATER)
#define NET80211_MAX_CHANNELS
The maximum number of channels we allow to be configured simultaneously.
Signal strength in arbitrary units.
uint32_t channel
RNDIS channel.
int(* change_key)(struct net80211_device *dev)
Change cryptographic key based on setting.
int net80211_prepare_assoc(struct net80211_device *dev, struct net80211_wlan *wlan)
Prepare 802.11 device channel and rate set for communication.
struct net80211_device * dev
802.11 device to probe on
int(* transmit)(struct net80211_device *dev, struct io_buffer *iobuf)
Transmit packet on 802.11 network device.
Hardware doesn't support 802.11g short slot operation.
int net80211_keep_mgmt(struct net80211_device *dev, int enable)
Set state of 802.11 device keeping management frames.
struct list_head * net80211_probe_finish_all(struct net80211_probe_ctx *ctx)
Finish probe of 802.11 networks, returning all networks found.
void * priv
Driver private data.
u8 nr_rates
The number of transmission rates in the rates array.
struct net80211_device * net80211_alloc(size_t priv_size)
Allocate 802.11 device.
int assoc_rc
Return status code associated with state.
u16 center_freq
The center frequency for this channel.
struct io_buffer * iob[16]
Buffers for each fragment.
struct net80211_assoc_ctx * assoc
u8 band
The band with which this channel is associated.
u32 start_ticks
Timestamp from point at which first fragment was collected.
Structure encapsulating the complete state of an 802.11 device.
No security, an "Open" network.
int net80211_probe_step(struct net80211_probe_ctx *ctx)
Continue probe of 802.11 networks.
Rate-control algorithm prototype for 802.11.
void net80211_free_wlanlist(struct list_head *list)
Free list of WLAN structures.
void net80211_autoassociate(struct net80211_device *dev)
Start 802.11 association process.
struct net80211_handshaker * handshaker
Security handshaker being used.
void net80211_free_wlan(struct net80211_wlan *wlan)
Free WLAN structure.
struct net80211_hw_info * hw
Information about the hardware, provided to net80211_register()
void net80211_tx_complete(struct net80211_device *dev, struct io_buffer *iob, int retries, int rc)
Indicate the completed transmission of a packet.
Any 802.11 information element.
Hardware doesn't support 2.4GHz short preambles.
int net80211_send_assoc(struct net80211_device *dev, struct net80211_wlan *wlan)
Send 802.11 association frame.
u16 rates[NET80211_MAX_RATES]
A list of all possible TX rates we might use.
struct net80211_device * net80211_get(struct net_device *netdev)
Get 802.11 device from wrapping network device.
struct net80211_wlan * net80211_probe_finish_best(struct net80211_probe_ctx *ctx)
Finish probe of 802.11 networks, returning best-signal network found.
struct net80211_wlan * associating
Network with which we are associating.
int phy_flags
Physical layer options.
Interface to an 802.11 security handshaking protocol.
void * priv
Private data for the algorithm to store key and state info.
struct list_head list
Link to allow chaining multiple structures into a list to be returned from net80211_probe_finish_all(...
Network device management.
int(* start)(struct net80211_device *dev)
Start handshaking.
struct net_device * netdev
The net_device that wraps us.
Received frames include a frame check sequence.
union net80211_device::@631 ctx
Context for the association process.
const struct setting net80211_key_setting __setting(SETTING_NETDEV_EXTRA, key)
802.11 encryption key setting
int channel
The channel on which that access point communicates.
#define NET80211_MAX_RATES
The maximum number of TX rates we allow to be configured simultaneously.
struct net80211_device_operations * op
802.11 device operations
net80211_crypto_alg
An 802.11 data encryption algorithm.
void(* close)(struct net80211_device *dev)
Close 802.11 network device.
int signal
Signal strength of beacon frame from that access point.
int nr_channels
Number of supported channels.
struct net80211_channel channels[NET80211_MAX_CHANNELS]
A list of all possible channels we might use.
enum net80211_hw_info::@629 flags
A set of flags indicating peculiarities of this device.
u16 last_rx_seq
Packet duplication elimination state.
int(* step)(struct net80211_device *dev)
Process handshaking state.
u8 bssid[ETH_ALEN]
MAC address of the strongest-signal access point for this ESSID.
static u16 net80211_cts_duration(struct net80211_device *dev, int size)
Calculate duration field for a CTS control frame.
int net80211_send_auth(struct net80211_device *dev, struct net80211_wlan *wlan, int method)
Send 802.11 initial authentication frame.
int bands
A bitwise OR of the bands on which this device can communicate.
u8 bssid[ETH_ALEN]
MAC address of the access point most recently associated.
Network protected with TKIP (better RC4-based system)
u16 state
State of our association to the network.
u16 seqnr
Sequence number of this MSDU (packet)
Interface to an 802.11 cryptosystem.
struct io_buffer * beacon
The complete beacon or probe-response frame received.
u8 channel_nr
A channel number interpreted according to the band.
u32 rx_beacon_interval
Smoothed average time between beacons, microseconds.
int net80211_tx_mgmt(struct net80211_device *dev, u16 fc, u8 bssid[ETH_ALEN], struct io_buffer *iob)
int net80211_change_channel(struct net80211_device *dev, int channel)
Configure 802.11 device to transmit on a certain channel.
int net80211_prepare_probe(struct net80211_device *dev, int band, int active)
Prepare 802.11 device channel and rate set for scanning.
unsigned channel_change_time
Estimate of the time required to change channels, in microseconds.
#define IEEE80211_MAX_SSID_LEN
Maximum length of an ESSID.
#define NET80211_NR_CONCURRENT_FRAGS
The number of fragments we can receive at once.
u8 rate
The rate currently in use, as an index into the rates array.
Signal strength in decibels relative to 1mW.
int net80211_register(struct net80211_device *dev, struct net80211_device_operations *ops, struct net80211_hw_info *hw)
Register 802.11 device with network stack.
u16 last_tx_seqnr
The sequence number of the last packet we sent.