iPXE
|
Functions | |
int | net80211_prepare_probe (struct net80211_device *dev, int band, int active) |
Prepare 802.11 device channel and rate set for scanning. More... | |
struct net80211_probe_ctx * | net80211_probe_start (struct net80211_device *dev, const char *essid, int active) |
Begin probe of 802.11 networks. More... | |
int | net80211_probe_step (struct net80211_probe_ctx *ctx) |
Continue probe of 802.11 networks. More... | |
struct net80211_wlan * | net80211_probe_finish_best (struct net80211_probe_ctx *ctx) |
Finish probe of 802.11 networks, returning best-signal network found. More... | |
struct list_head * | net80211_probe_finish_all (struct net80211_probe_ctx *ctx) |
Finish probe of 802.11 networks, returning all networks found. More... | |
void | net80211_free_wlan (struct net80211_wlan *wlan) |
Free WLAN structure. More... | |
void | net80211_free_wlanlist (struct list_head *list) |
Free list of WLAN structures. More... | |
int net80211_prepare_probe | ( | struct net80211_device * | dev, |
int | band, | ||
int | active | ||
) |
Prepare 802.11 device channel and rate set for scanning.
dev | 802.11 device |
band | RF band(s) on which to prepare for scanning |
active | Whether the scanning will be active |
rc | Return status code |
Definition at line 2051 of file net80211.c.
References assert(), net80211_channel::band, net80211_device::channel, net80211_device::channels, net80211_device_operations::config, DBGC, EINVAL_ACTIVE_SCAN, net80211_device::hw, net80211_add_channels(), NET80211_BAND_BIT_2GHZ, NET80211_BAND_BIT_5GHZ, NET80211_CFG_CHANNEL, NET80211_CFG_RATE, net80211_filter_hw_channels(), NET80211_REG_TXPOWER, net80211_device::netdev, netdev_is_open(), net80211_device::nr_channels, net80211_device::nr_rates, net80211_device::op, net80211_device::rate, net80211_hw_info::rates, and net80211_device::rates.
Referenced by iwlist(), and net80211_step_associate().
struct net80211_probe_ctx* net80211_probe_start | ( | struct net80211_device * | dev, |
const char * | essid, | ||
int | active | ||
) |
Begin probe of 802.11 networks.
dev | 802.11 device |
essid | SSID to probe for, or "" to accept any (may not be NULL) |
active | Whether to use active scanning |
ctx | Probe context |
Active scanning may only be used on channels 1-11 in the 2.4GHz band, due to iPXE's lack of a complete regulatory database. If active scanning is used, probe packets will be sent on each channel; this can allow association with hidden-SSID networks if the SSID is properly specified.
A NULL
return indicates an out-of-memory condition.
The returned context must be periodically passed to net80211_probe_step() until that function returns zero.
Definition at line 1290 of file net80211.c.
References alloc_iob(), assert(), net80211_device::channel, net80211_device_operations::config, ctx, currticks(), net80211_probe_ctx::dev, net80211_probe_ctx::essid, net80211_device::essid, IEEE80211_TYP_FRAME_HEADER_LEN, ieee80211_probe_req::info_element, INIT_LIST_HEAD, iob_put, iob_reserve, malloc(), NET80211_CFG_CHANNEL, net80211_keep_mgmt(), net80211_marshal_request_info(), net80211_device::netdev, netdev_is_open(), net80211_device::nr_channels, NULL, net80211_device::op, strcpy(), TICKS_PER_SEC, and zalloc().
Referenced by iwlist(), and net80211_step_associate().
int net80211_probe_step | ( | struct net80211_probe_ctx * | ctx | ) |
Continue probe of 802.11 networks.
ctx | Probe context returned by net80211_probe_start() |
rc | Probe status |
The return code will be 0 if the probe is still going on (and this function should be called again), a positive number if the probe completed successfully, or a negative error code if the probe failed for that reason.
Whether the probe succeeded or failed, you must call net80211_probe_finish_all() or net80211_probe_finish_best() (depending on whether you want information on all networks or just the best-signal one) in order to release the probe context. A failed probe may still have acquired some valid data.
Definition at line 1363 of file net80211.c.
References alloc_iob(), net80211_wlan::beacon, net80211_wlan::bssid, net80211_device::channel, net80211_wlan::channel, net80211_hw_info::channel_change_time, net80211_channel::channel_nr, net80211_device::channels, net80211_device_operations::config, net80211_wlan::crypto, ctx, currticks(), io_buffer::data, DBG, DBGC, DBGC2, ENOTSUP, net80211_wlan::essid, ETH_ALEN, eth_broadcast, eth_ntoa(), ETIMEDOUT, fill, free_iob(), net80211_wlan::handshaking, hdr, io_buffer::head, net80211_device::hw, ieee80211_ie::id, ieee80211_beacon, IEEE80211_CAPAB_PRIVACY, IEEE80211_FC_SUBTYPE, ieee80211_ie_bound(), IEEE80211_IE_SSID, IEEE80211_MAX_SSID_LEN, ieee80211_next_ie(), IEEE80211_STYPE_BEACON, IEEE80211_STYPE_PROBE_REQ, IEEE80211_STYPE_PROBE_RESP, if(), iob_disown, iob_headroom(), iob_len(), iob_put, iob_reserve, ieee80211_ie::len, net80211_wlan::list, list_add_tail, list_empty, list_for_each_entry, memcpy(), NET80211_CFG_CHANNEL, NET80211_CRYPT_NONE, NET80211_CRYPT_UNKNOWN, net80211_mgmt_dequeue(), NET80211_PROBE_GATHER, NET80211_PROBE_GATHER_ALL, NET80211_PROBE_TIMEOUT, NET80211_SECPROT_NONE, NET80211_SECPROT_UNKNOWN, net80211_tx_mgmt(), net80211_device::nr_channels, NULL, net80211_device::op, rc, sec80211_detect(), net80211_wlan::signal, ssid, ieee80211_ie::ssid, strcmp(), strcpy(), strerror(), io_buffer::tail, TICKS_PER_SEC, type, udelay(), and zalloc().
Referenced by iwlist(), and net80211_step_associate().
struct net80211_wlan* net80211_probe_finish_best | ( | struct net80211_probe_ctx * | ctx | ) |
Finish probe of 802.11 networks, returning best-signal network found.
ctx | Probe context |
wlan | Best-signal network found, or NULL if none were found |
If net80211_probe_start() was called with a particular SSID parameter as filter, only a network with that SSID (matching case-sensitively) can be returned from this function.
Definition at line 1544 of file net80211.c.
References ctx, DBGC, free, free_iob(), net80211_wlan::list, list_del, list_for_each_entry, net80211_free_wlanlist(), net80211_keep_mgmt(), NULL, and net80211_wlan::signal.
Referenced by net80211_autoassociate(), and net80211_step_associate().
struct list_head* net80211_probe_finish_all | ( | struct net80211_probe_ctx * | ctx | ) |
Finish probe of 802.11 networks, returning all networks found.
ctx | Probe context |
list | List of net80211_wlan detailing networks found |
If net80211_probe_start() was called with a particular SSID parameter as filter, this will always return either an empty or a one-element list.
Definition at line 1585 of file net80211.c.
References ctx, free, free_iob(), and net80211_keep_mgmt().
Referenced by iwlist().
void net80211_free_wlan | ( | struct net80211_wlan * | wlan | ) |
Free WLAN structure.
wlan | WLAN structure to free |
Definition at line 1605 of file net80211.c.
References net80211_wlan::beacon, free, and free_iob().
Referenced by net80211_autoassociate(), net80211_free_wlanlist(), and net80211_step_associate().
void net80211_free_wlanlist | ( | struct list_head * | list | ) |
Free list of WLAN structures.
list | List of WLAN structures to free |
Definition at line 1619 of file net80211.c.
References free, net80211_wlan::list, list_del, list_for_each_entry_safe, net80211_free_wlan(), and tmp.
Referenced by iwlist(), and net80211_probe_finish_best().