aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wps_supplicant.c
diff options
context:
space:
mode:
authorChristian Lamparter <chunkeey@googlemail.com>2011-10-23 08:58:54 (GMT)
committerJouni Malinen <j@w1.fi>2011-10-23 14:21:50 (GMT)
commit6bf731e8cea4d9d41665d271b331e096c7c569e9 (patch)
treea9e3dc2807ce9cc2b61b80c5ee366c366d464882 /wpa_supplicant/wps_supplicant.c
parente3b473eb4ebcc545ca922312eba6dcbb79c41bdf (diff)
downloadhostap-6bf731e8cea4d9d41665d271b331e096c7c569e9.zip
hostap-6bf731e8cea4d9d41665d271b331e096c7c569e9.tar.gz
hostap-6bf731e8cea4d9d41665d271b331e096c7c569e9.tar.bz2
wpa_supplicant: Unify hardware feature data
The hardware feature data is required in several different places throughout the code. Previously, the data was acquired and freed on demand, but with this patch wpa_supplicant will keep a single copy around at runtime for everyone to use. Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Diffstat (limited to 'wpa_supplicant/wps_supplicant.c')
-rw-r--r--wpa_supplicant/wps_supplicant.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
index ad521fd..c1e5e44 100644
--- a/wpa_supplicant/wps_supplicant.c
+++ b/wpa_supplicant/wps_supplicant.c
@@ -1121,7 +1121,7 @@ int wpas_wps_init(struct wpa_supplicant *wpa_s)
struct wps_context *wps;
struct wps_registrar_config rcfg;
struct hostapd_hw_modes *modes;
- u16 num_modes, flags, m;
+ u16 m;
wps = os_zalloc(sizeof(*wps));
if (wps == NULL)
@@ -1155,16 +1155,15 @@ int wpas_wps_init(struct wpa_supplicant *wpa_s)
WPS_DEV_TYPE_LEN * wps->dev.num_sec_dev_types);
wps->dev.os_version = WPA_GET_BE32(wpa_s->conf->os_version);
- modes = wpa_drv_get_hw_feature_data(wpa_s, &num_modes, &flags);
+ modes = wpa_s->hw.modes;
if (modes) {
- for (m = 0; m < num_modes; m++) {
+ for (m = 0; m < wpa_s->hw.num_modes; m++) {
if (modes[m].mode == HOSTAPD_MODE_IEEE80211B ||
modes[m].mode == HOSTAPD_MODE_IEEE80211G)
wps->dev.rf_bands |= WPS_RF_24GHZ;
else if (modes[m].mode == HOSTAPD_MODE_IEEE80211A)
wps->dev.rf_bands |= WPS_RF_50GHZ;
}
- ieee80211_sta_free_hw_features(modes, num_modes);
}
if (wps->dev.rf_bands == 0) {
/*