diff options
author | Thomas Pedersen <thomas@cozybit.com> | 2013-03-04 16:06:12 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-03-06 10:36:12 -0500 |
commit | a6dad6a26e15f2f9269eea41b756c8cf0971b2bc (patch) | |
tree | d2a70dcb7f9cb3711270bcb3be5e44ce99734b85 | |
parent | eef941e6d6be8bce72b5c2963b69f948be4df7a7 (diff) |
mac80211: support userspace MPM
Earlier mac80211 would check whether some kind of mesh
security was enabled, when the real question was "is the
MPM in userspace"?
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | net/mac80211/cfg.c | 3 | ||||
-rw-r--r-- | net/mac80211/ieee80211_i.h | 1 | ||||
-rw-r--r-- | net/mac80211/main.c | 3 | ||||
-rw-r--r-- | net/mac80211/mesh.c | 2 | ||||
-rw-r--r-- | net/mac80211/mesh_plink.c | 9 | ||||
-rw-r--r-- | net/mac80211/rx.c | 2 |
6 files changed, 14 insertions, 6 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 6ac89e5c2963..c6c7f6e0b585 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -1435,7 +1435,7 @@ static int ieee80211_change_station(struct wiphy *wiphy, | |||
1435 | 1435 | ||
1436 | switch (sdata->vif.type) { | 1436 | switch (sdata->vif.type) { |
1437 | case NL80211_IFTYPE_MESH_POINT: | 1437 | case NL80211_IFTYPE_MESH_POINT: |
1438 | if (sdata->u.mesh.security & IEEE80211_MESH_SEC_SECURED) | 1438 | if (sdata->u.mesh.user_mpm) |
1439 | statype = CFG80211_STA_MESH_PEER_USER; | 1439 | statype = CFG80211_STA_MESH_PEER_USER; |
1440 | else | 1440 | else |
1441 | statype = CFG80211_STA_MESH_PEER_KERNEL; | 1441 | statype = CFG80211_STA_MESH_PEER_KERNEL; |
@@ -1729,6 +1729,7 @@ static int copy_mesh_setup(struct ieee80211_if_mesh *ifmsh, | |||
1729 | ifmsh->mesh_sp_id = setup->sync_method; | 1729 | ifmsh->mesh_sp_id = setup->sync_method; |
1730 | ifmsh->mesh_pp_id = setup->path_sel_proto; | 1730 | ifmsh->mesh_pp_id = setup->path_sel_proto; |
1731 | ifmsh->mesh_pm_id = setup->path_metric; | 1731 | ifmsh->mesh_pm_id = setup->path_metric; |
1732 | ifmsh->user_mpm = setup->user_mpm; | ||
1732 | ifmsh->security = IEEE80211_MESH_SEC_NONE; | 1733 | ifmsh->security = IEEE80211_MESH_SEC_NONE; |
1733 | if (setup->is_authenticated) | 1734 | if (setup->is_authenticated) |
1734 | ifmsh->security |= IEEE80211_MESH_SEC_AUTHED; | 1735 | ifmsh->security |= IEEE80211_MESH_SEC_AUTHED; |
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 54d09ec3fe68..f4433f081e77 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -588,6 +588,7 @@ struct ieee80211_if_mesh { | |||
588 | IEEE80211_MESH_SEC_AUTHED = 0x1, | 588 | IEEE80211_MESH_SEC_AUTHED = 0x1, |
589 | IEEE80211_MESH_SEC_SECURED = 0x2, | 589 | IEEE80211_MESH_SEC_SECURED = 0x2, |
590 | } security; | 590 | } security; |
591 | bool user_mpm; | ||
591 | /* Extensible Synchronization Framework */ | 592 | /* Extensible Synchronization Framework */ |
592 | const struct ieee80211_mesh_sync_ops *sync_ops; | 593 | const struct ieee80211_mesh_sync_ops *sync_ops; |
593 | s64 sync_offset_clockdrift_max; | 594 | s64 sync_offset_clockdrift_max; |
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index a55a7075dd8c..5a53aa5ede80 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c | |||
@@ -569,7 +569,8 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, | |||
569 | wiphy->features |= NL80211_FEATURE_SK_TX_STATUS | | 569 | wiphy->features |= NL80211_FEATURE_SK_TX_STATUS | |
570 | NL80211_FEATURE_SAE | | 570 | NL80211_FEATURE_SAE | |
571 | NL80211_FEATURE_HT_IBSS | | 571 | NL80211_FEATURE_HT_IBSS | |
572 | NL80211_FEATURE_VIF_TXPOWER; | 572 | NL80211_FEATURE_VIF_TXPOWER | |
573 | NL80211_FEATURE_USERSPACE_MPM; | ||
573 | 574 | ||
574 | if (!ops->hw_scan) | 575 | if (!ops->hw_scan) |
575 | wiphy->features |= NL80211_FEATURE_LOW_PRIORITY_SCAN | | 576 | wiphy->features |= NL80211_FEATURE_LOW_PRIORITY_SCAN | |
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index f5d1afacee85..5ac017f3fcd2 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c | |||
@@ -156,7 +156,7 @@ void mesh_sta_cleanup(struct sta_info *sta) | |||
156 | * an update. | 156 | * an update. |
157 | */ | 157 | */ |
158 | changed = mesh_accept_plinks_update(sdata); | 158 | changed = mesh_accept_plinks_update(sdata); |
159 | if (sdata->u.mesh.security == IEEE80211_MESH_SEC_NONE) { | 159 | if (!sdata->u.mesh.user_mpm) { |
160 | changed |= mesh_plink_deactivate(sta); | 160 | changed |= mesh_plink_deactivate(sta); |
161 | del_timer_sync(&sta->plink_timer); | 161 | del_timer_sync(&sta->plink_timer); |
162 | } | 162 | } |
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c index 08df966320b8..e259951b0219 100644 --- a/net/mac80211/mesh_plink.c +++ b/net/mac80211/mesh_plink.c | |||
@@ -437,8 +437,9 @@ mesh_sta_info_alloc(struct ieee80211_sub_if_data *sdata, u8 *addr, | |||
437 | { | 437 | { |
438 | struct sta_info *sta = NULL; | 438 | struct sta_info *sta = NULL; |
439 | 439 | ||
440 | /* Userspace handles peer allocation when security is enabled */ | 440 | /* Userspace handles station allocation */ |
441 | if (sdata->u.mesh.security & IEEE80211_MESH_SEC_AUTHED) | 441 | if (sdata->u.mesh.user_mpm || |
442 | sdata->u.mesh.security & IEEE80211_MESH_SEC_AUTHED) | ||
442 | cfg80211_notify_new_peer_candidate(sdata->dev, addr, | 443 | cfg80211_notify_new_peer_candidate(sdata->dev, addr, |
443 | elems->ie_start, | 444 | elems->ie_start, |
444 | elems->total_len, | 445 | elems->total_len, |
@@ -670,6 +671,10 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, | |||
670 | if (len < IEEE80211_MIN_ACTION_SIZE + 3) | 671 | if (len < IEEE80211_MIN_ACTION_SIZE + 3) |
671 | return; | 672 | return; |
672 | 673 | ||
674 | if (sdata->u.mesh.user_mpm) | ||
675 | /* userspace must register for these */ | ||
676 | return; | ||
677 | |||
673 | if (is_multicast_ether_addr(mgmt->da)) { | 678 | if (is_multicast_ether_addr(mgmt->da)) { |
674 | mpl_dbg(sdata, | 679 | mpl_dbg(sdata, |
675 | "Mesh plink: ignore frame from multicast address\n"); | 680 | "Mesh plink: ignore frame from multicast address\n"); |
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 1f940e2b6f27..5b4492af4e85 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -2543,7 +2543,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) | |||
2543 | case WLAN_SP_MESH_PEERING_CONFIRM: | 2543 | case WLAN_SP_MESH_PEERING_CONFIRM: |
2544 | if (!ieee80211_vif_is_mesh(&sdata->vif)) | 2544 | if (!ieee80211_vif_is_mesh(&sdata->vif)) |
2545 | goto invalid; | 2545 | goto invalid; |
2546 | if (sdata->u.mesh.security != IEEE80211_MESH_SEC_NONE) | 2546 | if (sdata->u.mesh.user_mpm) |
2547 | /* userspace handles this frame */ | 2547 | /* userspace handles this frame */ |
2548 | break; | 2548 | break; |
2549 | goto queue; | 2549 | goto queue; |