aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd/main.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2013-11-03 19:16:33 (GMT)
committerJouni Malinen <j@w1.fi>2013-11-03 19:30:31 (GMT)
commit0dfd2c61a5707a0ad18c0f609060c20d6e199e34 (patch)
treed4dfb37d8638626ab5b9b83aee81d729ff8fb0d9 /hostapd/main.c
parent1b3926ef73f18b82d4525fe5f1741add7349b358 (diff)
downloadhostap-0dfd2c61a5707a0ad18c0f609060c20d6e199e34.zip
hostap-0dfd2c61a5707a0ad18c0f609060c20d6e199e34.tar.gz
hostap-0dfd2c61a5707a0ad18c0f609060c20d6e199e34.tar.bz2
Document AP mode startup functions
This provides some more details on how interfaces and BSSes are initialized during hostapd startup. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'hostapd/main.c')
-rw-r--r--hostapd/main.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/hostapd/main.c b/hostapd/main.c
index 05d6273..bc61db1 100644
--- a/hostapd/main.c
+++ b/hostapd/main.c
@@ -147,6 +147,9 @@ static void hostapd_logger_cb(void *ctx, const u8 *addr, unsigned int module,
#endif /* CONFIG_NO_HOSTAPD_LOGGER */
+/**
+ * hostapd_driver_init - Preparate driver interface
+ */
static int hostapd_driver_init(struct hostapd_iface *iface)
{
struct wpa_init_params params;
@@ -226,6 +229,13 @@ static int hostapd_driver_init(struct hostapd_iface *iface)
}
+/**
+ * hostapd_interface_init - Read configuration file and init BSS data
+ *
+ * This function is used to parse configuration file for a full interface (one
+ * or more BSSes sharing the same radio) and allocate memory for the BSS
+ * interfaces. No actiual driver operations are started.
+ */
static struct hostapd_iface *
hostapd_interface_init(struct hapd_interfaces *interfaces,
const char *config_fname, int debug)
@@ -628,7 +638,7 @@ int main(int argc, char *argv[])
return -1;
}
- /* Initialize interfaces */
+ /* Allocate and parse configuration for full interface files */
for (i = 0; i < interfaces.count; i++) {
interfaces.iface[i] = hostapd_interface_init(&interfaces,
argv[optind + i],
@@ -639,6 +649,7 @@ int main(int argc, char *argv[])
}
}
+ /* Allocate and parse configuration for per-BSS files */
for (i = 0; i < num_bss_configs; i++) {
struct hostapd_iface *iface;
char *fname;
@@ -674,6 +685,14 @@ int main(int argc, char *argv[])
}
}
+ /*
+ * Enable configured interfaces. Depending on channel configuration,
+ * this may complete full initialization before returning or use a
+ * callback mechanism to complete setup in case of operations like HT
+ * co-ex scans, ACS, or DFS are needed to determine channel parameters.
+ * In such case, the interface will be enabled from eloop context within
+ * hostapd_global_run().
+ */
for (i = 0; i < interfaces.count; i++) {
if (hostapd_driver_init(interfaces.iface[i]) ||
hostapd_setup_interface(interfaces.iface[i]))