Functions | Variables
802.11 settings handlers


static int net80211_check_settings_update (void)
 Check for 802.11 SSID or key updates.
struct setting
__setting (SETTING_NETDEV_EXTRA, ssid)
 The network name to associate with.
struct setting
__setting (SETTING_NETDEV_EXTRA, active-scan)
 Whether to use active scanning.
struct setting net80211_key_setting __setting (SETTING_NETDEV_EXTRA, key)
 The cryptographic key to use.


struct settings_applicator
 802.11 settings applicator

Function Documentation

static int net80211_check_settings_update ( void  ) [static]

Check for 802.11 SSID or key updates.

This acts as a settings applicator; if the user changes netX/ssid, and netX is currently open, the association task will be invoked again. If the user changes the encryption key, the current security handshaker will be asked to update its state to match; if that is impossible without reassociation, we reassociate.

Definition at line 1891 of file net80211.c.

References net80211_handshaker::change_key, DBGC, net80211_device::essid, fetch_string_setting(), net80211_device::handshaker, IEEE80211_MAX_SSID_LEN, net80211_device::list, list_for_each_entry, NET80211_AUTO_SSID, net80211_autoassociate(), net80211_device::netdev, netdev_is_open(), netdev_settings(), ssid, net80211_device::state, and strcmp().

        struct net80211_device *dev;
        char ssid[IEEE80211_MAX_SSID_LEN + 1];
        int key_reassoc;

        list_for_each_entry ( dev, &net80211_devices, list ) {
                if ( ! netdev_is_open ( dev->netdev ) )

                key_reassoc = 0;
                if ( dev->handshaker && dev->handshaker->change_key &&
                     dev->handshaker->change_key ( dev ) < 0 )
                        key_reassoc = 1;

                fetch_string_setting ( netdev_settings ( dev->netdev ),
                                       &net80211_ssid_setting, ssid,
                                       IEEE80211_MAX_SSID_LEN + 1 );

                if ( key_reassoc ||
                     ( ! ( ! ssid[0] && ( dev->state & NET80211_AUTO_SSID ) ) &&
                       strcmp ( ssid, dev->essid ) != 0 ) ) {
                        DBGC ( dev, "802.11 %p updating association: "
                               "%s -> %s\n", dev, dev->essid, ssid );
                        net80211_autoassociate ( dev );

        return 0;
struct setting net80211_ssid_setting __setting ( SETTING_NETDEV_EXTRA  ,
) [read]

The network name to associate with.

If this is blank, we scan for all networks and use the one with the greatest signal strength.

struct setting net80211_active_setting __setting ( SETTING_NETDEV_EXTRA  ,
active-  scan 
) [read]

Whether to use active scanning.

In order to associate with a hidden SSID, it's necessary to use an active scan (send probe packets). If this setting is nonzero, an active scan on the 2.4GHz band will be used to associate.

struct setting net80211_key_setting __setting ( SETTING_NETDEV_EXTRA  ,
) [read]

The cryptographic key to use.

For hex WEP keys, as is common, this must be entered using the normal iPXE method for entering hex settings; an ASCII string of hex characters will not behave as expected.

Variable Documentation

struct settings_applicator net80211_applicator __settings_applicator
Initial value:

802.11 settings applicator

When the SSID is changed, this will cause any open devices to re-associate; when the encryption key is changed, we similarly update their state.

Definition at line 198 of file net80211.c.