aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorSudhakar Swaminathan <Sudhakar.Swaminathan@Atheros.com>2010-09-08 18:18:10 (GMT)
committerJouni Malinen <j@w1.fi>2010-09-10 17:30:26 (GMT)
commit0f66abd25bde08f4bf8464002430f14e58125930 (patch)
treee3ed38f4212d92934b5e7ede16b918f5b3439b07 /wpa_supplicant
parent0d0a8ca1cc14acb30b6681818427b21798698ed6 (diff)
downloadhostap-0f66abd25bde08f4bf8464002430f14e58125930.zip
hostap-0f66abd25bde08f4bf8464002430f14e58125930.tar.gz
hostap-0f66abd25bde08f4bf8464002430f14e58125930.tar.bz2
P2P: Add option for disabling intra BSS distribution
p2p_intra_bss configuration parameter can now be used to disable/enable intra BSS distribution (bridging of frames between the clients in a group).
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/ap.c1
-rw-r--r--wpa_supplicant/config.c2
-rw-r--r--wpa_supplicant/config.h3
-rw-r--r--wpa_supplicant/config_file.c3
-rw-r--r--wpa_supplicant/driver_i.h8
-rw-r--r--wpa_supplicant/p2p_supplicant.c5
6 files changed, 22 insertions, 0 deletions
diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c
index 5d9edfa..26a1d11 100644
--- a/wpa_supplicant/ap.c
+++ b/wpa_supplicant/ap.c
@@ -302,6 +302,7 @@ int wpa_supplicant_create_ap(struct wpa_supplicant *wpa_s,
if (ssid->mode == WPAS_MODE_P2P_GO ||
ssid->mode == WPAS_MODE_P2P_GROUP_FORMATION)
params.p2p = 1;
+ wpa_drv_set_intra_bss(wpa_s, wpa_s->conf->p2p_intra_bss);
#endif /* CONFIG_P2P */
if (wpa_s->parent->set_ap_uapsd)
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index 4b74880..6e03760 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -2144,6 +2144,7 @@ struct wpa_config * wpa_config_alloc_empty(const char *ctrl_interface,
config->ap_scan = DEFAULT_AP_SCAN;
config->fast_reauth = DEFAULT_FAST_REAUTH;
config->p2p_go_intent = DEFAULT_P2P_GO_INTENT;
+ config->p2p_intra_bss = DEFAULT_P2P_INTRA_BSS;
config->bss_max_count = DEFAULT_BSS_MAX_COUNT;
if (ctrl_interface)
@@ -2400,6 +2401,7 @@ static const struct global_parse_data global_fields[] = {
{ INT_RANGE(p2p_go_intent, 0, 15), 0 },
{ STR(p2p_ssid_postfix), CFG_CHANGED_P2P_SSID_POSTFIX },
{ INT_RANGE(persistent_reconnect, 0, 1), 0 },
+ { INT_RANGE(p2p_intra_bss, 0, 1), CFG_CHANGED_P2P_INTRA_BSS },
#endif /* CONFIG_P2P */
{ FUNC(country), CFG_CHANGED_COUNTRY },
{ INT(bss_max_count), 0 },
diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h
index d3291cd..246c65f 100644
--- a/wpa_supplicant/config.h
+++ b/wpa_supplicant/config.h
@@ -23,6 +23,7 @@
#endif /* CONFIG_NO_SCAN_PROCESSING */
#define DEFAULT_FAST_REAUTH 1
#define DEFAULT_P2P_GO_INTENT 7
+#define DEFAULT_P2P_INTRA_BSS 1
#define DEFAULT_BSS_MAX_COUNT 200
#include "config_ssid.h"
@@ -37,6 +38,7 @@
#define CFG_CHANGED_SEC_DEVICE_TYPE BIT(6)
#define CFG_CHANGED_P2P_SSID_POSTFIX BIT(7)
#define CFG_CHANGED_WPS_STRING BIT(8)
+#define CFG_CHANGED_P2P_INTRA_BSS BIT(9)
/**
* struct wpa_config - wpa_supplicant configuration data
@@ -361,6 +363,7 @@ struct wpa_config {
int p2p_go_intent;
char *p2p_ssid_postfix;
int persistent_reconnect;
+ int p2p_intra_bss;
/**
* bss_max_count - Maximum number of BSS entries to keep in memory
diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c
index 1b9cc60..0f343fd 100644
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
@@ -673,6 +673,9 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config)
if (config->persistent_reconnect)
fprintf(f, "persistent_reconnect=%u\n",
config->persistent_reconnect);
+ if (config->p2p_intra_bss != DEFAULT_P2P_INTRA_BSS)
+ fprintf(f, "p2p_intra_bss=%u\n", config->p2p_intra_bss);
+
#endif /* CONFIG_P2P */
if (config->country[0] && config->country[1]) {
fprintf(f, "country=%c%c\n",
diff --git a/wpa_supplicant/driver_i.h b/wpa_supplicant/driver_i.h
index bfc5b74..b5c9fc8 100644
--- a/wpa_supplicant/driver_i.h
+++ b/wpa_supplicant/driver_i.h
@@ -424,6 +424,14 @@ static inline int wpa_drv_if_remove(struct wpa_supplicant *wpa_s,
return -1;
}
+static inline int wpa_drv_set_intra_bss(struct wpa_supplicant *wpa_s,
+ int enabled)
+{
+ if (wpa_s->driver->set_intra_bss)
+ return wpa_s->driver->set_intra_bss(wpa_s->drv_priv, enabled);
+ return -1;
+}
+
static inline int wpa_drv_remain_on_channel(struct wpa_supplicant *wpa_s,
unsigned int freq,
unsigned int duration)
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index 39d6654..056d6f1 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -2201,6 +2201,8 @@ int wpas_p2p_init(struct wpa_global *global, struct wpa_supplicant *wpa_s)
p2p.ssid_postfix_len);
}
+ p2p.p2p_intra_bss = wpa_s->conf->p2p_intra_bss;
+
global->p2p = p2p_init(&p2p);
if (global->p2p == NULL)
return -1;
@@ -3395,6 +3397,9 @@ void wpas_p2p_update_config(struct wpa_supplicant *wpa_s)
os_strlen(wpa_s->conf->p2p_ssid_postfix) :
0);
}
+
+ if (wpa_s->conf->changed_parameters & CFG_CHANGED_P2P_INTRA_BSS)
+ p2p_set_intra_bss_dist(p2p, wpa_s->conf->p2p_intra_bss);
}