Add more wpa_supplicant AP mode parameters for the driver wrapper

This makes it easier to configure AP mode for drivers that take care
of WPA/RSN IE generation.
This commit is contained in:
Jouni Malinen 2010-04-11 20:02:01 +03:00 committed by Jouni Malinen
parent 4b768ed0b2
commit 508545f3a9
3 changed files with 24 additions and 2 deletions

View file

@ -169,6 +169,26 @@ int wpa_supplicant_create_ap(struct wpa_supplicant *wpa_s,
}
params.freq = ssid->frequency;
if (ssid->key_mgmt & WPA_KEY_MGMT_PSK)
wpa_s->key_mgmt = WPA_KEY_MGMT_PSK;
else
wpa_s->key_mgmt = WPA_KEY_MGMT_NONE;
params.key_mgmt_suite = key_mgmt2driver(wpa_s->key_mgmt);
if (ssid->pairwise_cipher & WPA_CIPHER_CCMP)
wpa_s->pairwise_cipher = WPA_CIPHER_CCMP;
else if (ssid->pairwise_cipher & WPA_CIPHER_TKIP)
wpa_s->pairwise_cipher = WPA_CIPHER_TKIP;
else if (ssid->pairwise_cipher & WPA_CIPHER_NONE)
wpa_s->pairwise_cipher = WPA_CIPHER_NONE;
else {
wpa_printf(MSG_WARNING, "WPA: Failed to select pairwise "
"cipher.");
return -1;
}
params.pairwise_suite = cipher_suite2driver(wpa_s->pairwise_cipher);
params.group_suite = params.pairwise_suite;
if (wpa_drv_associate(wpa_s, &params) < 0) {
wpa_msg(wpa_s, MSG_INFO, "Failed to start AP functionality");
return -1;

View file

@ -688,7 +688,7 @@ static void wpa_supplicant_reconfig(int sig, void *signal_ctx)
}
static enum wpa_cipher cipher_suite2driver(int cipher)
enum wpa_cipher cipher_suite2driver(int cipher)
{
switch (cipher) {
case WPA_CIPHER_NONE:
@ -706,7 +706,7 @@ static enum wpa_cipher cipher_suite2driver(int cipher)
}
static enum wpa_key_mgmt key_mgmt2driver(int key_mgmt)
enum wpa_key_mgmt key_mgmt2driver(int key_mgmt)
{
switch (key_mgmt) {
case WPA_KEY_MGMT_NONE:

View file

@ -497,6 +497,8 @@ int wpa_supplicant_scard_init(struct wpa_supplicant *wpa_s,
void wpa_supplicant_terminate_proc(struct wpa_global *global);
void wpa_supplicant_rx_eapol(void *ctx, const u8 *src_addr,
const u8 *buf, size_t len);
enum wpa_key_mgmt key_mgmt2driver(int key_mgmt);
enum wpa_cipher cipher_suite2driver(int cipher);
/* events.c */
void wpa_supplicant_mark_disassoc(struct wpa_supplicant *wpa_s);