aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVishal Mahaveer <vishalm@ti.com>2012-12-11 10:28:54 -0600
committerVishal Mahaveer <vishalm@ti.com>2012-12-11 10:28:54 -0600
commit68bd90b2df35d0854416f4f8bb79c5fc073237fa (patch)
treed9f566e78fcb1efd93740a0cdc7dc7bbd01fe713 /src
parent0613a964c52b31d6763fd30dd45521314f3a2429 (diff)
parent4e1835b2ccb4698e8e7022522928317d219bca32 (diff)
downloadexternal_wpa_supplicant_8_ti-68bd90b2df35d0854416f4f8bb79c5fc073237fa.zip
external_wpa_supplicant_8_ti-68bd90b2df35d0854416f4f8bb79c5fc073237fa.tar.gz
external_wpa_supplicant_8_ti-68bd90b2df35d0854416f4f8bb79c5fc073237fa.tar.bz2
Merge commit 'ol_r8.a5.06' into p-jb-mr1-release
Conflicts: wpa_supplicant/wpa_supplicant_template.conf Change-Id: Ifb38077650e8bb6075a17b8f2232f14b704281f1 Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
Diffstat (limited to 'src')
-rw-r--r--src/ap/hostapd.c56
-rw-r--r--src/ap/hostapd.h3
-rw-r--r--src/drivers/driver_nl80211.c2
-rw-r--r--src/p2p/p2p.c8
-rw-r--r--src/p2p/p2p.h15
-rw-r--r--src/p2p/p2p_go_neg.c3
-rw-r--r--src/p2p/p2p_i.h1
7 files changed, 68 insertions, 20 deletions
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index 4e06808..ac9ef26 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -1137,3 +1137,59 @@ hostapd_channel_data *hostapd_get_valid_channel(struct hostapd_data *hapd,
wpa_printf(MSG_WARNING, "Could't get requested channel");
return NULL;
}
+
+void hostapd_macaddr_acl_accept_sta(struct hostapd_data *hapd)
+{
+ struct sta_info *sta = NULL;
+
+ if (hapd->conf->macaddr_acl != DENY_UNLESS_ACCEPTED)
+ return;
+
+ for (sta = hapd->sta_list; sta; sta = sta->next) {
+ if (!hostapd_maclist_found(hapd->conf->accept_mac,
+ hapd->conf->num_accept_mac, sta->addr, NULL)) {
+ hostapd_drv_sta_deauth(hapd, sta->addr,
+ WLAN_REASON_PREV_AUTH_NOT_VALID);
+ ap_sta_deauthenticate(hapd, sta,
+ WLAN_REASON_PREV_AUTH_NOT_VALID);
+ }
+ }
+}
+
+void hostapd_macaddr_acl_deny_sta(struct hostapd_data *hapd)
+{
+ struct sta_info *sta = NULL;
+
+ if (hapd->conf->macaddr_acl != ACCEPT_UNLESS_DENIED)
+ return;
+
+ for (sta = hapd->sta_list; sta; sta = sta->next) {
+ if (hostapd_maclist_found(hapd->conf->deny_mac,
+ hapd->conf->num_deny_mac, sta->addr, NULL)) {
+ hostapd_drv_sta_deauth(hapd, sta->addr,
+ WLAN_REASON_PREV_AUTH_NOT_VALID);
+ ap_sta_deauthenticate(hapd, sta,
+ WLAN_REASON_PREV_AUTH_NOT_VALID);
+ }
+ }
+}
+
+int hostapd_macaddr_acl_command(struct hostapd_data *hapd, char *cmd)
+{
+ int ret = 0;
+
+ if (os_strcasecmp(cmd, "accept") == 0) {
+ wpa_printf(MSG_DEBUG, "Changing to access control accept list");
+ hapd->conf->macaddr_acl = DENY_UNLESS_ACCEPTED;
+ hostapd_macaddr_acl_accept_sta(hapd);
+ } else if (os_strcasecmp(cmd, "deny") == 0) {
+ wpa_printf(MSG_DEBUG, "Changing to accees control deny list");
+ hapd->conf->macaddr_acl = ACCEPT_UNLESS_DENIED;
+ hostapd_macaddr_acl_deny_sta(hapd);
+ } else {
+ wpa_printf(MSG_ERROR, "Unknown acl command");
+ ret = -1;
+ }
+
+ return ret;
+}
diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
index feea42d..6193200 100644
--- a/src/ap/hostapd.h
+++ b/src/ap/hostapd.h
@@ -276,6 +276,9 @@ void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
struct
hostapd_channel_data *hostapd_get_valid_channel(struct hostapd_data *hapd,
int req_freq);
+void hostapd_macaddr_acl_accept_sta(struct hostapd_data *hapd);
+void hostapd_macaddr_acl_deny_sta(struct hostapd_data *hapd);
+int hostapd_macaddr_acl_command(struct hostapd_data *hapd, char *cmd);
/* utils.c */
int hostapd_register_probereq_cb(struct hostapd_data *hapd,
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 7254ecc..b68dbd1 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -9788,6 +9788,8 @@ static int wpa_driver_nl80211_driver_cmd(void *priv, char *cmd, char *buf,
} else if (os_strncasecmp(cmd, "SETBAND ", 8) == 0) {
/* Do nothing: Handled by wpa_supplicant_driver_cmd */
return 0;
+ } else if(os_strncasecmp(cmd, "COUNTRY ", 8) == 0) {
+ return wpa_driver_nl80211_set_country(priv, cmd + 8);
} else if (os_strcasecmp(cmd, "RXFILTER-START") == 0) {
return nl80211_set_wowlan_triggers(bss, 1);
} else if (os_strcasecmp(cmd, "RXFILTER-STOP") == 0) {
diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index e905e77..824a59e 100644
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
@@ -4102,14 +4102,6 @@ int p2p_in_progress(struct p2p_data *p2p)
return p2p->state != P2P_IDLE && p2p->state != P2P_PROVISIONING;
}
-int p2p_non_idle(struct p2p_data *p2p)
-{
- if (p2p == NULL)
- return 0;
- return p2p->state != P2P_IDLE;
-}
-
-
void p2p_set_config_timeout(struct p2p_data *p2p, u8 go_timeout,
u8 client_timeout)
{
diff --git a/src/p2p/p2p.h b/src/p2p/p2p.h
index 3f796d0..a60974f 100644
--- a/src/p2p/p2p.h
+++ b/src/p2p/p2p.h
@@ -1690,16 +1690,6 @@ int p2p_set_pref_chan(struct p2p_data *p2p, unsigned int num_pref_chan,
*/
int p2p_in_progress(struct p2p_data *p2p);
-/**
- * p2p_non_idle - Check whether P2P is not in P2P_IDLE. That
- * means we're in either search, GO neg or provisioing. Once connected
- * it's back to idle. p2p_in_progress excludes provisioing.
- * @p2p: P2P module context from p2p_init()
- * Returns: 0 if P2P module is idle or 1 if an operation is in progress
- */
-int p2p_non_idle(struct p2p_data *p2p);
-
-
#ifdef ANDROID_P2P
/**
* p2p_search_in_progress - Check whether a P2P SEARCH is in progress
@@ -1736,4 +1726,9 @@ int p2p_prepare_channel(struct p2p_data *p2p, unsigned int force_freq);
void p2p_set_config_timeout(struct p2p_data *p2p, u8 go_timeout,
u8 client_timeout);
+/**
+ * p2p_group_get_interface_addr - Get the interface address of a P2P group
+ * @group: P2P group context from p2p_group_init()
+ */
+const u8 *p2p_group_get_interface_addr(struct p2p_group *group);
#endif /* P2P_H */
diff --git a/src/p2p/p2p_go_neg.c b/src/p2p/p2p_go_neg.c
index 2d31f4b..60c19c6 100644
--- a/src/p2p/p2p_go_neg.c
+++ b/src/p2p/p2p_go_neg.c
@@ -827,6 +827,7 @@ void p2p_process_go_neg_resp(struct p2p_data *p2p, const u8 *sa,
return;
}
dev->flags &= ~P2P_DEV_WAIT_GO_NEG_RESPONSE;
+ p2p->cfg->send_action_done(p2p->cfg->cb_ctx);
if (msg.dialog_token != dev->dialog_token) {
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
@@ -860,7 +861,6 @@ void p2p_process_go_neg_resp(struct p2p_data *p2p, const u8 *sa,
"P2P: Stop GO Negotiation attempt");
p2p_go_neg_failed(p2p, dev, *msg.status);
}
- p2p->cfg->send_action_done(p2p->cfg->cb_ctx);
p2p_parse_free(&msg);
return;
}
@@ -1097,6 +1097,7 @@ void p2p_process_go_neg_conf(struct p2p_data *p2p, const u8 *sa,
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
"P2P: Received GO Negotiation Confirm from " MACSTR,
MAC2STR(sa));
+ p2p->cfg->send_action_done(p2p->cfg->cb_ctx);
dev = p2p_get_device(p2p, sa);
if (dev == NULL || dev->wps_method == WPS_NOT_READY ||
dev != p2p->go_neg_peer) {
diff --git a/src/p2p/p2p_i.h b/src/p2p/p2p_i.h
index d254818..9e3fd6f 100644
--- a/src/p2p/p2p_i.h
+++ b/src/p2p/p2p_i.h
@@ -557,7 +557,6 @@ struct p2p_noa_desc {
};
/* p2p_group.c */
-const u8 * p2p_group_get_interface_addr(struct p2p_group *group);
u8 p2p_group_presence_req(struct p2p_group *group,
const u8 *client_interface_addr,
const u8 *noa, size_t noa_len);