aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd
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 /hostapd
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 'hostapd')
-rw-r--r--hostapd/config_file.c2
-rw-r--r--hostapd/hostapd.conf9
-rw-r--r--hostapd/main.c23
3 files changed, 32 insertions, 2 deletions
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index 14d4ee7..dfe8ab7 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -3488,6 +3488,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
bss->mbo_enabled = atoi(pos);
} else if (os_strcmp(buf, "mbo_cell_data_conn_pref") == 0) {
bss->mbo_cell_data_conn_pref = atoi(pos);
+ } else if (os_strcmp(buf, "oce") == 0) {
+ bss->oce = atoi(pos);
#endif /* CONFIG_MBO */
#ifdef CONFIG_TESTING_OPTIONS
#define PARSE_TEST_PROBABILITY(_val) \
diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
index 980c138..51c47e6 100644
--- a/hostapd/hostapd.conf
+++ b/hostapd/hostapd.conf
@@ -2091,6 +2091,15 @@ own_ip_addr=127.0.0.1
# 255 = AP prefers the STA to use cellular data connection
#mbo_cell_data_conn_pref=1
+##### Optimized Connectivity Experience (OCE) #################################
+#
+# Enable OCE specific features (bitmap)
+# BIT(0) - Reserved
+# Set BIT(1) (= 2) to enable OCE in STA-CFON mode
+# Set BIT(2) (= 4) to enable OCE in AP mode
+# Default is 0 = OCE disabled
+#oce=0
+
##### Fast Session Transfer (FST) support #####################################
#
# The options in this section are only available when the build configuration
diff --git a/hostapd/main.c b/hostapd/main.c
index 785b320..ce94d05 100644
--- a/hostapd/main.c
+++ b/hostapd/main.c
@@ -869,8 +869,27 @@ int main(int argc, char *argv[])
*/
interfaces.terminate_on_error = interfaces.count;
for (i = 0; i < interfaces.count; i++) {
- if (hostapd_driver_init(interfaces.iface[i]) ||
- hostapd_setup_interface(interfaces.iface[i]))
+ if (hostapd_driver_init(interfaces.iface[i]))
+ goto out;
+#ifdef CONFIG_MBO
+ for (j = 0; j < interfaces.iface[i]->num_bss; j++) {
+ struct hostapd_data *hapd = interfaces.iface[i]->bss[j];
+
+ if (hapd && (hapd->conf->oce & OCE_STA_CFON) &&
+ (interfaces.iface[i]->drv_flags &
+ WPA_DRIVER_FLAGS_OCE_STA_CFON))
+ hapd->enable_oce = OCE_STA_CFON;
+
+ if (hapd && (hapd->conf->oce & OCE_AP) &&
+ (interfaces.iface[i]->drv_flags &
+ WPA_DRIVER_FLAGS_OCE_STA_CFON)) {
+ /* TODO: Need to add OCE-AP support */
+ wpa_printf(MSG_ERROR,
+ "OCE-AP feature is not yet supported");
+ }
+ }
+#endif /* CONFIG_MBO */
+ if (hostapd_setup_interface(interfaces.iface[i]))
goto out;
}