aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd
diff options
context:
space:
mode:
authorTed Merrill <ted@atheros.com>2008-01-08 03:27:27 (GMT)
committerJouni Malinen <j@w1.fi>2008-01-08 03:27:27 (GMT)
commit33ef1f91b589a7fc9aa41aecc6bac1e48616e8b4 (patch)
tree38b36db2de41441afac76ce17a72065434b655ce /hostapd
parentfb450644c11a01816309491bd957b0ca0c9cecdc (diff)
downloadhostap-history-33ef1f91b589a7fc9aa41aecc6bac1e48616e8b4.zip
hostap-history-33ef1f91b589a7fc9aa41aecc6bac1e48616e8b4.tar.gz
hostap-history-33ef1f91b589a7fc9aa41aecc6bac1e48616e8b4.tar.bz2
madwifi: Added support for configuring WPS IE for Beacon and Probe Resp
(based on patch from Ted Merrill with some minor cleanup and changes to match with the current driver handler function prototypes)
Diffstat (limited to 'hostapd')
-rw-r--r--hostapd/driver_madwifi.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/hostapd/driver_madwifi.c b/hostapd/driver_madwifi.c
index d97ca17..993a31b 100644
--- a/hostapd/driver_madwifi.c
+++ b/hostapd/driver_madwifi.c
@@ -742,6 +742,45 @@ madwifi_del_sta(struct madwifi_driver_data *drv, u8 addr[IEEE80211_ADDR_LEN])
return 0;
}
+#ifdef CONFIG_WPS
+static int
+madwifi_set_wps_ie(void *priv, const u8 *ie, size_t len, u32 frametype)
+{
+ struct madwifi_driver_data *drv = priv;
+ u8 buf[256];
+ struct ieee80211req_getset_appiebuf *beac_ie;
+
+ wpa_printf(MSG_DEBUG, "%s buflen = %d", __func__, len);
+
+ beac_ie = (struct ieee80211req_getset_appiebuf *) buf;
+ beac_ie->app_frmtype = frametype;
+ beac_ie->app_buflen = len;
+ memcpy(&(beac_ie->app_buf[0]), ie, len);
+
+ return set80211priv(drv, IEEE80211_IOCTL_SET_APPIEBUF, beac_ie,
+ sizeof(struct ieee80211req_getset_appiebuf) + len);
+ return 0;
+}
+
+static int
+madwifi_set_wps_beacon_ie(const char *ifname, void *priv, const u8 *ie,
+ size_t len)
+{
+ 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,
+ IEEE80211_APPIE_FRAME_PROBE_RESP);
+}
+#else /* CONFIG_WPS */
+#define madwifi_set_wps_beacon_ie NULL
+#define madwifi_set_wps_probe_resp_ie NULL
+#endif /* CONFIG_WPS */
+
static int
madwifi_process_wpa_ie(struct madwifi_driver_data *drv, struct sta_info *sta)
{
@@ -1342,4 +1381,6 @@ const struct wpa_driver_ops wpa_driver_madwifi_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,
};