[PATCH] driver_nl80211: implement hapd_set_ssid callback

Arik Nemtsov arik
Thu Jan 20 05:00:42 PST 2011


When operating in AP mode, this callback passes the SSID to the kernel
driver.

wl12xx cards handle probe requests in FW. When the SSID is not
broadcast in beacon data (i.e. the SSID is hidden), the AP must know the
real SSID in order to respond to directed probe requests.

Signed-off-by: Arik Nemtsov <arik at wizery.com>
---
 src/drivers/driver_nl80211.c |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index acb8f33..fe46afd 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -5293,7 +5293,8 @@ static int i802_set_tx_queue_params(void *priv, int queue, int aifs,
 }
 
 
-static int i802_set_bss(void *priv, int cts, int preamble, int slot)
+static int i802_set_bss(void *priv, int cts, int preamble, int slot,
+			int ssid_len, const u8 *ssid)
 {
 	struct i802_bss *bss = priv;
 	struct wpa_driver_nl80211_data *drv = bss->drv;
@@ -5312,6 +5313,8 @@ static int i802_set_bss(void *priv, int cts, int preamble, int slot)
 		NLA_PUT_U8(msg, NL80211_ATTR_BSS_SHORT_PREAMBLE, preamble);
 	if (slot >= 0)
 		NLA_PUT_U8(msg, NL80211_ATTR_BSS_SHORT_SLOT_TIME, slot);
+	if (ssid_len > 0)
+		NLA_PUT(msg, NL80211_ATTR_SSID, ssid_len, ssid);
 
 	NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, if_nametoindex(bss->ifname));
 
@@ -5323,19 +5326,25 @@ static int i802_set_bss(void *priv, int cts, int preamble, int slot)
 
 static int i802_set_cts_protect(void *priv, int value)
 {
-	return i802_set_bss(priv, value, -1, -1);
+	return i802_set_bss(priv, value, -1, -1, -1, NULL);
 }
 
 
 static int i802_set_preamble(void *priv, int value)
 {
-	return i802_set_bss(priv, -1, value, -1);
+	return i802_set_bss(priv, -1, value, -1, -1, NULL);
 }
 
 
 static int i802_set_short_slot_time(void *priv, int value)
 {
-	return i802_set_bss(priv, -1, -1, value);
+	return i802_set_bss(priv, -1, -1, value, -1, NULL);
+}
+
+
+static int i802_set_ssid(void *priv, const u8 *ssid, int ssid_len)
+{
+	return i802_set_bss(priv, -1, -1, -1, ssid_len, ssid);
 }
 
 
@@ -6407,6 +6416,7 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
 	.set_tx_queue_params = i802_set_tx_queue_params,
 	.set_sta_vlan = i802_set_sta_vlan,
 	.set_wds_sta = i802_set_wds_sta,
+	.hapd_set_ssid = i802_set_ssid,
 #endif /* HOSTAPD */
 	.set_freq = i802_set_freq,
 	.send_action = wpa_driver_nl80211_send_action,
-- 
1.7.1




More information about the Hostap mailing list