summaryrefslogtreecommitdiffstats
path: root/src/net/80211
diff options
context:
space:
mode:
authorMichael Brown2013-12-03 17:48:56 +0100
committerMichael Brown2013-12-05 01:37:02 +0100
commit22001cb206c1320aee27f679a63d2171d35e99c5 (patch)
treea972bb914371a68d4925dcc007238dcb836546ba /src/net/80211
parent[fbcon] Add support for displaying a cursor (diff)
downloadipxe-22001cb206c1320aee27f679a63d2171d35e99c5.tar.gz
ipxe-22001cb206c1320aee27f679a63d2171d35e99c5.tar.xz
ipxe-22001cb206c1320aee27f679a63d2171d35e99c5.zip
[settings] Explicitly separate the concept of a completed fetched setting
The fetch_setting() family of functions may currently modify the definition of the specified setting (e.g. to add missing type information). Clean up this interface by requiring callers to provide an explicit buffer to contain the completed definition of the fetched setting, if required. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net/80211')
-rw-r--r--src/net/80211/net80211.c6
-rw-r--r--src/net/80211/wep.c8
2 files changed, 7 insertions, 7 deletions
diff --git a/src/net/80211/net80211.c b/src/net/80211/net80211.c
index 3893f652..db4dc116 100644
--- a/src/net/80211/net80211.c
+++ b/src/net/80211/net80211.c
@@ -204,7 +204,7 @@ struct settings_applicator net80211_applicator __settings_applicator = {
* If this is blank, we scan for all networks and use the one with the
* greatest signal strength.
*/
-struct setting net80211_ssid_setting __setting ( SETTING_NETDEV_EXTRA ) = {
+const struct setting net80211_ssid_setting __setting ( SETTING_NETDEV_EXTRA ) = {
.name = "ssid",
.description = "Wireless SSID",
.type = &setting_type_string,
@@ -216,7 +216,7 @@ struct setting net80211_ssid_setting __setting ( SETTING_NETDEV_EXTRA ) = {
* 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_active_setting __setting ( SETTING_NETDEV_EXTRA ) = {
+const struct setting net80211_active_setting __setting ( SETTING_NETDEV_EXTRA ) = {
.name = "active-scan",
.description = "Actively scan for wireless networks",
.type = &setting_type_int8,
@@ -228,7 +228,7 @@ struct setting net80211_active_setting __setting ( SETTING_NETDEV_EXTRA ) = {
* normal iPXE method for entering hex settings; an ASCII string of
* hex characters will not behave as expected.
*/
-struct setting net80211_key_setting __setting ( SETTING_NETDEV_EXTRA ) = {
+const struct setting net80211_key_setting __setting ( SETTING_NETDEV_EXTRA ) = {
.name = "key",
.description = "Wireless encryption key",
.type = &setting_type_string,
diff --git a/src/net/80211/wep.c b/src/net/80211/wep.c
index 37b27f71..e22ac899 100644
--- a/src/net/80211/wep.c
+++ b/src/net/80211/wep.c
@@ -236,8 +236,8 @@ static int trivial_init ( struct net80211_device *dev )
dev->associating->crypto == NET80211_CRYPT_NONE )
return 0; /* no crypto? OK. */
- len = fetch_setting ( netdev_settings ( dev->netdev ),
- &net80211_key_setting, key, WEP_MAX_KEY );
+ len = fetch_raw_setting ( netdev_settings ( dev->netdev ),
+ &net80211_key_setting, key, WEP_MAX_KEY );
if ( len <= 0 ) {
DBGC ( dev, "802.11 %p cannot do WEP without a key\n", dev );
@@ -278,8 +278,8 @@ static int trivial_change_key ( struct net80211_device *dev )
if ( ! dev->crypto || ( dev->crypto->init != wep_init ) )
change ^= 1;
- len = fetch_setting ( netdev_settings ( dev->netdev ),
- &net80211_key_setting, key, WEP_MAX_KEY );
+ len = fetch_raw_setting ( netdev_settings ( dev->netdev ),
+ &net80211_key_setting, key, WEP_MAX_KEY );
if ( len <= 0 )
change ^= 1;