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
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 else1440 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, · 287 unmodified lines
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;
net/mac80211/ieee80211_i.h+1−0
@@ -588,6 +588,7 @@ struct ieee80211_if_mesh { · 587 unmodified lines
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;
net/mac80211/main.c+2−1
@@ -569,7 +569,8 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, · 568 unmodified lines
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 |
net/mac80211/mesh.c+1−1
@@ -156,7 +156,7 @@ void mesh_sta_cleanup(struct sta_info *sta) · 155 unmodified lines
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 }
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
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, · 225 unmodified lines
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");
net/mac80211/rx.c+1−1
@@ -2543,7 +2543,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) · 2542 unmodified lines
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;

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