aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/driver_atheros.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2009-12-24 17:46:06 (GMT)
committerJouni Malinen <j@w1.fi>2009-12-24 17:46:06 (GMT)
commit14f7938660b1d41dc05ecef44a7dbb56ba34e9ad (patch)
tree5ba1e697d073870a6ad426a03d7879bd37749686 /src/drivers/driver_atheros.c
parentbf65bc638fe438b96f2986580ad167d5e276ef4c (diff)
downloadhostap-14f7938660b1d41dc05ecef44a7dbb56ba34e9ad.zip
hostap-14f7938660b1d41dc05ecef44a7dbb56ba34e9ad.tar.gz
hostap-14f7938660b1d41dc05ecef44a7dbb56ba34e9ad.tar.bz2
Merge driver ops set_wps_beacon_ie and set_wps_probe_resp_ie
set_ap_wps_ie() is not used to set WPS IE for both Beacon and Probe Response frames with a single call. In addition, struct wpabuf is used instead of separate u8* and length fields. This avoids duplicated allocation of the IEs and simplifies code in general.
Diffstat (limited to 'src/drivers/driver_atheros.c')
-rw-r--r--src/drivers/driver_atheros.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/drivers/driver_atheros.c b/src/drivers/driver_atheros.c
index bd958c1..c3e09c4 100644
--- a/src/drivers/driver_atheros.c
+++ b/src/drivers/driver_atheros.c
@@ -715,22 +715,21 @@ madwifi_set_wps_ie(void *priv, const u8 *ie, size_t len, u32 frametype)
}
static int
-madwifi_set_wps_beacon_ie(const char *ifname, void *priv, const u8 *ie,
- size_t len)
+madwifi_set_ap_wps_ie(const char *ifname, void *priv,
+ const struct wpabuf *beacon,
+ const struct wpabuf *proberesp)
{
- return madwifi_set_wps_ie(priv, ie, len, IEEE80211_APPIE_FRAME_BEACON);
-}
-
-static int
-madwifi_set_wps_probe_resp_ie(const char *ifname, void *priv, const u8 *ie,
- size_t len)
-{
- return madwifi_set_wps_ie(priv, ie, len,
+ if (madwifi_set_wps_ie(priv, beacon ? wpabuf_head(beacon) : NULL,
+ beacon ? wpabuf_len(beacon) : 0,
+ IEEE80211_APPIE_FRAME_BEACON))
+ return -1;
+ return madwifi_set_wps_ie(priv,
+ proberesp ? wpabuf_head(proberesp) : NULL,
+ proberesp ? wpabuf_len(proberesp): 0,
IEEE80211_APPIE_FRAME_PROBE_RESP);
}
#else /* CONFIG_WPS */
-#define madwifi_set_wps_beacon_ie NULL
-#define madwifi_set_wps_probe_resp_ie NULL
+#define madwifi_set_ap_wps_ie NULL
#endif /* CONFIG_WPS */
static int
@@ -1249,6 +1248,5 @@ const struct wpa_driver_ops wpa_driver_atheros_ops = {
.set_countermeasures = madwifi_set_countermeasures,
.sta_clear_stats = madwifi_sta_clear_stats,
.commit = madwifi_commit,
- .set_wps_beacon_ie = madwifi_set_wps_beacon_ie,
- .set_wps_probe_resp_ie = madwifi_set_wps_probe_resp_ie,
+ .set_ap_wps_ie = madwifi_set_ap_wps_ie,
};