History

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"?

Thomas Pedersen committed 13 years ago

Commit a6dad6a1 parent eef941e6 files · +14 −6Browse files

Unified · Split

6 files
  1. net/mac80211/cfg.c +2 −1
  2. net/mac80211/ieee80211_i.h +1 −0
  3. net/mac80211/main.c +2 −1
  4. net/mac80211/mesh.c +1 −1
  5. net/mac80211/mesh_plink.c +7 −2
  6. net/mac80211/rx.c +1 −1
net/mac80211/cfg.c+2−1
@@ -1435,7 +1435,7 @@ static int ieee80211_change_station(struct wiphy *wiphy, · 1434 unmodified lines
14351435
14361436 switch (sdata->vif.type) {
14371437 case NL80211_IFTYPE_MESH_POINT:
1438− if (sdata->u.mesh.security & IEEE80211_MESH_SEC_SECURED)
1438+ if (sdata->u.mesh.user_mpm)
14391439 statype = CFG80211_STA_MESH_PEER_USER;
14401440 else
14411441 statype = CFG80211_STA_MESH_PEER_KERNEL;
@@ -1729,6 +1729,7 @@ static int copy_mesh_setup(struct ieee80211_if_mesh *ifmsh, · 287 unmodified lines
17291729 ifmsh->mesh_sp_id = setup->sync_method;
17301730 ifmsh->mesh_pp_id = setup->path_sel_proto;
17311731 ifmsh->mesh_pm_id = setup->path_metric;
1732+ ifmsh->user_mpm = setup->user_mpm;
17321733 ifmsh->security = IEEE80211_MESH_SEC_NONE;
17331734 if (setup->is_authenticated)
17341735 ifmsh->security |= IEEE80211_MESH_SEC_AUTHED;
net/mac80211/ieee80211_i.h+1−0
@@ -588,6 +588,7 @@ struct ieee80211_if_mesh { · 587 unmodified lines
588588 IEEE80211_MESH_SEC_AUTHED = 0x1,
589589 IEEE80211_MESH_SEC_SECURED = 0x2,
590590 } security;
591+ bool user_mpm;
591592 /* Extensible Synchronization Framework */
592593 const struct ieee80211_mesh_sync_ops *sync_ops;
593594 s64 sync_offset_clockdrift_max;
net/mac80211/main.c+2−1
@@ -569,7 +569,8 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, · 568 unmodified lines
569569 wiphy->features |= NL80211_FEATURE_SK_TX_STATUS |
570570 NL80211_FEATURE_SAE |
571571 NL80211_FEATURE_HT_IBSS |
572− NL80211_FEATURE_VIF_TXPOWER;
572+ NL80211_FEATURE_VIF_TXPOWER |
573+ NL80211_FEATURE_USERSPACE_MPM;
573574
574575 if (!ops->hw_scan)
575576 wiphy->features |= NL80211_FEATURE_LOW_PRIORITY_SCAN |
net/mac80211/mesh.c+1−1
@@ -156,7 +156,7 @@ void mesh_sta_cleanup(struct sta_info *sta) · 155 unmodified lines
156156 * an update.
157157 */
158158 changed = mesh_accept_plinks_update(sdata);
159− if (sdata->u.mesh.security == IEEE80211_MESH_SEC_NONE) {
159+ if (!sdata->u.mesh.user_mpm) {
160160 changed |= mesh_plink_deactivate(sta);
161161 del_timer_sync(&sta->plink_timer);
162162 }
net/mac80211/mesh_plink.c+7−2
@@ -437,8 +437,9 @@ mesh_sta_info_alloc(struct ieee80211_sub_if_data *sdata, u8 *addr, · 436 unmodified lines
437437 {
438438 struct sta_info *sta = NULL;
439439
440− /* Userspace handles peer allocation when security is enabled */
441− if (sdata->u.mesh.security & IEEE80211_MESH_SEC_AUTHED)
440+ /* Userspace handles station allocation */
441+ if (sdata->u.mesh.user_mpm ||
442+ sdata->u.mesh.security & IEEE80211_MESH_SEC_AUTHED)
442443 cfg80211_notify_new_peer_candidate(sdata->dev, addr,
443444 elems->ie_start,
444445 elems->total_len,
@@ -670,6 +671,10 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, · 225 unmodified lines
670671 if (len < IEEE80211_MIN_ACTION_SIZE + 3)
671672 return;
672673
674+ if (sdata->u.mesh.user_mpm)
675+ /* userspace must register for these */
676+ return;
677+
673678 if (is_multicast_ether_addr(mgmt->da)) {
674679 mpl_dbg(sdata,
675680 "Mesh plink: ignore frame from multicast address\n");
net/mac80211/rx.c+1−1
@@ -2543,7 +2543,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) · 2542 unmodified lines
25432543 case WLAN_SP_MESH_PEERING_CONFIRM:
25442544 if (!ieee80211_vif_is_mesh(&sdata->vif))
25452545 goto invalid;
2546− if (sdata->u.mesh.security != IEEE80211_MESH_SEC_NONE)
2546+ if (sdata->u.mesh.user_mpm)
25472547 /* userspace handles this frame */
25482548 break;
25492549 goto queue;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t