aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAshwini Patil <c_apati@qti.qualcomm.com>2017-06-16 12:17:03 (GMT)
committerJouni Malinen <j@w1.fi>2017-07-14 18:27:00 (GMT)
commit65833d71a5f3b8240db397efa7200e894a3eab1f (patch)
tree5d5409c4bc0a2b7098743c11addb93ed26047108 /src
parent332aadb8a226947c4eb34067223c26753a676477 (diff)
downloadhostap-65833d71a5f3b8240db397efa7200e894a3eab1f.zip
hostap-65833d71a5f3b8240db397efa7200e894a3eab1f.tar.gz
hostap-65833d71a5f3b8240db397efa7200e894a3eab1f.tar.bz2
OCE: Add hostapd mode OCE capability indication if enabled
Add OCE IE in Beacon, Probe Response, and (Re)Association Response frames if OCE is enabled in the configuration. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'src')
-rw-r--r--src/ap/ap_config.h7
-rw-r--r--src/ap/ap_drv_ops.c2
-rw-r--r--src/ap/hostapd.h5
-rw-r--r--src/ap/ieee802_11_shared.c43
-rw-r--r--src/common/defs.h1
5 files changed, 48 insertions, 10 deletions
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
index 14fa230..8e5ff52 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -605,6 +605,13 @@ struct hostapd_bss_config {
#ifdef CONFIG_MBO
int mbo_enabled;
+ /**
+ * oce - Enable OCE in AP and/or STA-CFON mode
+ * - BIT(0) is Reserved
+ * - Set BIT(1) to enable OCE in STA-CFON mode
+ * - Set BIT(2) to enable OCE in AP mode
+ */
+ unsigned int oce;
int mbo_cell_data_conn_pref;
#endif /* CONFIG_MBO */
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
index b3d4f03..8f4d839 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
@@ -176,7 +176,7 @@ int hostapd_build_ap_extra_ies(struct hostapd_data *hapd,
#endif /* CONFIG_HS20 */
#ifdef CONFIG_MBO
- if (hapd->conf->mbo_enabled) {
+ if (hapd->conf->mbo_enabled || hapd->enable_oce) {
pos = hostapd_eid_mbo(hapd, buf, sizeof(buf));
if (add_buf_data(&beacon, buf, pos - buf) < 0 ||
add_buf_data(&proberesp, buf, pos - buf) < 0 ||
diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
index 8580d80..fc19c25 100644
--- a/src/ap/hostapd.h
+++ b/src/ap/hostapd.h
@@ -308,6 +308,11 @@ struct hostapd_data {
#ifdef CONFIG_MBO
unsigned int mbo_assoc_disallow;
+ /**
+ * enable_oce - Enable OCE if it is enabled by user and device also
+ * supports OCE.
+ */
+ u8 enable_oce;
#endif /* CONFIG_MBO */
struct dl_list nr_db;
diff --git a/src/ap/ieee802_11_shared.c b/src/ap/ieee802_11_shared.c
index 4d5ec2f..bf6d4cc 100644
--- a/src/ap/ieee802_11_shared.c
+++ b/src/ap/ieee802_11_shared.c
@@ -544,23 +544,38 @@ u8 * hostapd_eid_bss_max_idle_period(struct hostapd_data *hapd, u8 *eid)
u8 * hostapd_eid_mbo(struct hostapd_data *hapd, u8 *eid, size_t len)
{
- u8 mbo[6], *mbo_pos = mbo;
+ u8 mbo[9], *mbo_pos = mbo;
u8 *pos = eid;
- if (!hapd->conf->mbo_enabled)
+ if (!hapd->conf->mbo_enabled && !hapd->enable_oce)
return eid;
- *mbo_pos++ = MBO_ATTR_ID_AP_CAPA_IND;
- *mbo_pos++ = 1;
- /* Not Cellular aware */
- *mbo_pos++ = 0;
+ if (hapd->conf->mbo_enabled) {
+ *mbo_pos++ = MBO_ATTR_ID_AP_CAPA_IND;
+ *mbo_pos++ = 1;
+ /* Not Cellular aware */
+ *mbo_pos++ = 0;
+ }
- if (hapd->mbo_assoc_disallow) {
+ if (hapd->conf->mbo_enabled && hapd->mbo_assoc_disallow) {
*mbo_pos++ = MBO_ATTR_ID_ASSOC_DISALLOW;
*mbo_pos++ = 1;
*mbo_pos++ = hapd->mbo_assoc_disallow;
}
+ if (hapd->enable_oce & (OCE_AP | OCE_STA_CFON)) {
+ u8 ctrl;
+
+ ctrl = OCE_RELEASE;
+ if ((hapd->enable_oce & (OCE_AP | OCE_STA_CFON)) ==
+ OCE_STA_CFON)
+ ctrl |= OCE_IS_STA_CFON;
+
+ *mbo_pos++ = OCE_ATTR_ID_CAPA_IND;
+ *mbo_pos++ = 1;
+ *mbo_pos++ = ctrl;
+ }
+
pos += mbo_add_ie(pos, len, mbo, mbo_pos - mbo);
return pos;
@@ -569,14 +584,24 @@ u8 * hostapd_eid_mbo(struct hostapd_data *hapd, u8 *eid, size_t len)
u8 hostapd_mbo_ie_len(struct hostapd_data *hapd)
{
- if (!hapd->conf->mbo_enabled)
+ u8 len;
+
+ if (!hapd->conf->mbo_enabled && !hapd->enable_oce)
return 0;
/*
* MBO IE header (6) + Capability Indication attribute (3) +
* Association Disallowed attribute (3) = 12
*/
- return 6 + 3 + (hapd->mbo_assoc_disallow ? 3 : 0);
+ len = 6;
+ if (hapd->conf->mbo_enabled)
+ len += 3 + (hapd->mbo_assoc_disallow ? 3 : 0);
+
+ /* OCE capability indication attribute (3) */
+ if (hapd->enable_oce & (OCE_AP | OCE_STA_CFON))
+ len += 3;
+
+ return len;
}
#endif /* CONFIG_MBO */
diff --git a/src/common/defs.h b/src/common/defs.h
index f15c5cc..1de099f 100644
--- a/src/common/defs.h
+++ b/src/common/defs.h
@@ -391,5 +391,6 @@ enum eap_proxy_sim_state {
#define OCE_STA BIT(0)
#define OCE_STA_CFON BIT(1)
+#define OCE_AP BIT(2)
#endif /* DEFS_H */