Add SSID as a separate item in AP mode Beacon setup
authorJouni Malinen <jouni@qca.qualcomm.com>
Wed, 10 Aug 2011 10:29:32 +0000 (13:29 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 10 Aug 2011 10:29:32 +0000 (13:29 +0300)
This makes it easier for drivers that need the SSID to get it from the
Beacon setup operation without having to parse the Beacon IEs.

src/ap/beacon.c
src/drivers/driver.h
src/drivers/driver_nl80211.c

index 136856c..3fd49f2 100644 (file)
@@ -518,6 +518,8 @@ void ieee802_11_set_beacon(struct hostapd_data *hapd)
        params.tail_len = tail_len;
        params.dtim_period = hapd->conf->dtim_period;
        params.beacon_int = hapd->iconf->beacon_int;
+       params.ssid = (u8 *) hapd->conf->ssid.ssid;
+       params.ssid_len = hapd->conf->ssid.ssid_len;
        if (hostapd_drv_set_ap(hapd, &params))
                wpa_printf(MSG_ERROR, "Failed to set beacon parameters");
 
index 36e6ca9..e2d0f8b 100644 (file)
@@ -530,6 +530,16 @@ struct wpa_driver_ap_params {
         * beacon_int - Beacon interval
         */
        int beacon_int;
+
+       /**
+        * ssid - The SSID to use in Beacon/Probe Response frames
+        */
+       const u8 *ssid;
+
+       /**
+        * ssid_len - Length of the SSID (1..32)
+        */
+       size_t ssid_len;
 };
 
 /**
index 9726cbf..1cb2196 100644 (file)
@@ -3847,6 +3847,8 @@ static int wpa_driver_nl80211_set_ap(void *priv,
        NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, ifindex);
        NLA_PUT_U32(msg, NL80211_ATTR_BEACON_INTERVAL, params->beacon_int);
        NLA_PUT_U32(msg, NL80211_ATTR_DTIM_PERIOD, params->dtim_period);
+       NLA_PUT(msg, NL80211_ATTR_SSID, params->ssid_len,
+               params->ssid);
 
        ret = send_and_recv_msgs(drv, msg, NULL, NULL);
        if (ret) {