* Returns: 0 on success or -1 on failure
*/
int (*ampdu)(void *priv, int ampdu);
+
+ /**
+ * set_intra_bss - Enables/Disables intra BSS bridging
+ */
+ int (*set_intra_bss)(void *priv, int enabled);
};
NULL /* get_noa */,
NULL /* set_noa */,
NULL /* set_p2p_powersave */,
- NULL /* ampdu */
+ NULL /* ampdu */,
+ NULL /* set_intra_bss */
};
return -1;
return dev->oper_freq;
}
+
+
+void p2p_set_intra_bss_dist(struct p2p_data *p2p, int enabled)
+{
+ wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG, "P2P: Intra BSS distribution %s",
+ enabled ? "enabled" : "disabled");
+ p2p->cfg->p2p_intra_bss = enabled;
+}
size_t max_peers;
/**
+ * p2p_intra_bss - Intra BSS communication is supported
+ */
+ int p2p_intra_bss;
+
+ /**
* ssid_postfix - Postfix data to add to the SSID
*
* This data will be added to the end of the SSID after the
int p2p_add_device(struct p2p_data *p2p, const u8 *addr, int freq, int level,
const u8 *ies, size_t ies_len);
+/**
+ * p2p_set_intra_bss_dist - Set intra BSS distribution
+ * @p2p: P2P module context from p2p_init()
+ * @enabled: Whether intra BSS distribution will be enabled
+ */
+void p2p_set_intra_bss_dist(struct p2p_data *p2p, int enabled);
+
#endif /* P2P_H */
group_capab |= P2P_GROUP_CAPAB_PERSISTENT_GROUP;
if (p2p->cross_connect)
group_capab |= P2P_GROUP_CAPAB_CROSS_CONN;
+ if (p2p->cfg->p2p_intra_bss)
+ group_capab |= P2P_GROUP_CAPAB_INTRA_BSS_DIST;
p2p_buf_add_capability(buf, p2p->dev_capab, group_capab);
p2p_buf_add_go_intent(buf, (p2p->go_intent << 1) |
p2p->next_tie_breaker);
group_capab |= P2P_GROUP_CAPAB_PERSISTENT_GROUP;
if (p2p->cross_connect)
group_capab |= P2P_GROUP_CAPAB_CROSS_CONN;
+ if (p2p->cfg->p2p_intra_bss)
+ group_capab |= P2P_GROUP_CAPAB_INTRA_BSS_DIST;
}
p2p_buf_add_capability(buf, p2p->dev_capab, group_capab);
p2p_buf_add_go_intent(buf, (p2p->go_intent << 1) | tie_breaker);
group_capab |= P2P_GROUP_CAPAB_PERSISTENT_GROUP;
if (p2p->cross_connect)
group_capab |= P2P_GROUP_CAPAB_CROSS_CONN;
+ if (p2p->cfg->p2p_intra_bss)
+ group_capab |= P2P_GROUP_CAPAB_INTRA_BSS_DIST;
}
p2p_buf_add_capability(buf, p2p->dev_capab, group_capab);
if (go || resp_chan == NULL)
group_capab |= P2P_GROUP_CAPAB_GROUP_OWNER;
if (group->cfg->persistent_group)
group_capab |= P2P_GROUP_CAPAB_PERSISTENT_GROUP;
- group_capab |= P2P_GROUP_CAPAB_INTRA_BSS_DIST;
+ if (group->p2p->cfg->p2p_intra_bss)
+ group_capab |= P2P_GROUP_CAPAB_INTRA_BSS_DIST;
if (group->group_formation)
group_capab |= P2P_GROUP_CAPAB_GROUP_FORMATION;
if (group->p2p->cross_connect)
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)
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)
{ 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 },
#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"
#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
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
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",
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)
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;
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);
}