aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJavier Cardona <javier@cozybit.com>2010-12-16 20:37:50 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-12-20 14:46:58 -0500
commitc7108a7111cd9e592d6ad498be37276dbea75d2b (patch)
treedab25dbb5607c4151629bf747ee10b4487772419 /net
parentc80d545da3f7c0e534ccd4a780f322f80a92cff1 (diff)
mac80211: Send mesh non-HWMP path selection frames to userspace
Let path selection frames for protocols other than HWMP be sent to userspace via NL80211_CMD_REGISTER_FRAME. Also allow userspace to send and receive mesh path selection frames. Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/cfg.c1
-rw-r--r--net/mac80211/main.c4
-rw-r--r--net/mac80211/mesh.c13
-rw-r--r--net/mac80211/mesh.h7
-rw-r--r--net/mac80211/rx.c5
-rw-r--r--net/wireless/nl80211.c2
6 files changed, 21 insertions, 11 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index ae2c7127a8aa..5892b0302454 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1670,6 +1670,7 @@ static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct net_device *dev,
1670 case NL80211_IFTYPE_AP: 1670 case NL80211_IFTYPE_AP:
1671 case NL80211_IFTYPE_AP_VLAN: 1671 case NL80211_IFTYPE_AP_VLAN:
1672 case NL80211_IFTYPE_P2P_GO: 1672 case NL80211_IFTYPE_P2P_GO:
1673 case NL80211_IFTYPE_MESH_POINT:
1673 if (!ieee80211_is_action(mgmt->frame_control) || 1674 if (!ieee80211_is_action(mgmt->frame_control) ||
1674 mgmt->u.action.category == WLAN_CATEGORY_PUBLIC) 1675 mgmt->u.action.category == WLAN_CATEGORY_PUBLIC)
1675 break; 1676 break;
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index d87eb005690f..a21d049caf19 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -484,6 +484,10 @@ ieee80211_default_mgmt_stypes[NUM_NL80211_IFTYPES] = {
484 BIT(IEEE80211_STYPE_DEAUTH >> 4) | 484 BIT(IEEE80211_STYPE_DEAUTH >> 4) |
485 BIT(IEEE80211_STYPE_ACTION >> 4), 485 BIT(IEEE80211_STYPE_ACTION >> 4),
486 }, 486 },
487 [NL80211_IFTYPE_MESH_POINT] = {
488 .tx = 0xffff,
489 .rx = BIT(IEEE80211_STYPE_ACTION >> 4),
490 },
487}; 491};
488 492
489struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, 493struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index c326e009389d..8b5906c83f93 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -124,15 +124,6 @@ void mesh_accept_plinks_update(struct ieee80211_sub_if_data *sdata)
124 ieee80211_mesh_housekeeping_timer((unsigned long) sdata); 124 ieee80211_mesh_housekeeping_timer((unsigned long) sdata);
125} 125}
126 126
127void mesh_ids_set_default(struct ieee80211_if_mesh *sta)
128{
129 sta->mesh_pp_id = 0; /* HWMP */
130 sta->mesh_pm_id = 0; /* Airtime */
131 sta->mesh_cc_id = 0; /* Disabled */
132 sta->mesh_sp_id = 0; /* Neighbor Offset */
133 sta->mesh_auth_id = 0; /* Disabled */
134}
135
136int mesh_rmc_init(struct ieee80211_sub_if_data *sdata) 127int mesh_rmc_init(struct ieee80211_sub_if_data *sdata)
137{ 128{
138 int i; 129 int i;
@@ -525,6 +516,9 @@ void ieee80211_start_mesh(struct ieee80211_sub_if_data *sdata)
525 atomic_inc(&local->iff_allmultis); 516 atomic_inc(&local->iff_allmultis);
526 ieee80211_configure_filter(local); 517 ieee80211_configure_filter(local);
527 518
519 ifmsh->mesh_cc_id = 0; /* Disabled */
520 ifmsh->mesh_sp_id = 0; /* Neighbor Offset */
521 ifmsh->mesh_auth_id = 0; /* Disabled */
528 set_bit(MESH_WORK_HOUSEKEEPING, &ifmsh->wrkq_flags); 522 set_bit(MESH_WORK_HOUSEKEEPING, &ifmsh->wrkq_flags);
529 ieee80211_mesh_root_setup(ifmsh); 523 ieee80211_mesh_root_setup(ifmsh);
530 ieee80211_queue_work(&local->hw, &sdata->work); 524 ieee80211_queue_work(&local->hw, &sdata->work);
@@ -695,7 +689,6 @@ void ieee80211_mesh_init_sdata(struct ieee80211_sub_if_data *sdata)
695 /* Allocate all mesh structures when creating the first mesh interface. */ 689 /* Allocate all mesh structures when creating the first mesh interface. */
696 if (!mesh_allocated) 690 if (!mesh_allocated)
697 ieee80211s_init(); 691 ieee80211s_init();
698 mesh_ids_set_default(ifmsh);
699 setup_timer(&ifmsh->mesh_path_timer, 692 setup_timer(&ifmsh->mesh_path_timer,
700 ieee80211_mesh_path_timer, 693 ieee80211_mesh_path_timer,
701 (unsigned long) sdata); 694 (unsigned long) sdata);
diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h
index 5b828fa8c541..890dd19c2eca 100644
--- a/net/mac80211/mesh.h
+++ b/net/mac80211/mesh.h
@@ -284,6 +284,11 @@ static inline void mesh_path_activate(struct mesh_path *mpath)
284 mpath->flags |= MESH_PATH_ACTIVE | MESH_PATH_RESOLVED; 284 mpath->flags |= MESH_PATH_ACTIVE | MESH_PATH_RESOLVED;
285} 285}
286 286
287static inline bool mesh_path_sel_is_hwmp(struct ieee80211_sub_if_data *sdata)
288{
289 return sdata->u.mesh.mesh_pp_id == IEEE80211_PATH_PROTOCOL_HWMP;
290}
291
287#define for_each_mesh_entry(x, p, node, i) \ 292#define for_each_mesh_entry(x, p, node, i) \
288 for (i = 0; i <= x->hash_mask; i++) \ 293 for (i = 0; i <= x->hash_mask; i++) \
289 hlist_for_each_entry_rcu(node, p, &x->hash_buckets[i], list) 294 hlist_for_each_entry_rcu(node, p, &x->hash_buckets[i], list)
@@ -304,6 +309,8 @@ static inline void ieee80211_mesh_restart(struct ieee80211_sub_if_data *sdata)
304{} 309{}
305static inline void mesh_plink_quiesce(struct sta_info *sta) {} 310static inline void mesh_plink_quiesce(struct sta_info *sta) {}
306static inline void mesh_plink_restart(struct sta_info *sta) {} 311static inline void mesh_plink_restart(struct sta_info *sta) {}
312static inline bool mesh_path_sel_is_hwmp(struct ieee80211_sub_if_data *sdata)
313{ return false; }
307#endif 314#endif
308 315
309#endif /* IEEE80211S_H */ 316#endif /* IEEE80211S_H */
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 4573ce1e1d15..7c5d1b2ec453 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2161,10 +2161,13 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
2161 } 2161 }
2162 break; 2162 break;
2163 case WLAN_CATEGORY_MESH_PLINK: 2163 case WLAN_CATEGORY_MESH_PLINK:
2164 case WLAN_CATEGORY_MESH_PATH_SEL:
2165 if (!ieee80211_vif_is_mesh(&sdata->vif)) 2164 if (!ieee80211_vif_is_mesh(&sdata->vif))
2166 break; 2165 break;
2167 goto queue; 2166 goto queue;
2167 case WLAN_CATEGORY_MESH_PATH_SEL:
2168 if (!mesh_path_sel_is_hwmp(sdata))
2169 break;
2170 goto queue;
2168 } 2171 }
2169 2172
2170 return RX_CONTINUE; 2173 return RX_CONTINUE;
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index eef89d0b558b..6a5d6fa11e46 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -4445,6 +4445,7 @@ static int nl80211_register_mgmt(struct sk_buff *skb, struct genl_info *info)
4445 dev->ieee80211_ptr->iftype != NL80211_IFTYPE_P2P_CLIENT && 4445 dev->ieee80211_ptr->iftype != NL80211_IFTYPE_P2P_CLIENT &&
4446 dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP && 4446 dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP &&
4447 dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP_VLAN && 4447 dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP_VLAN &&
4448 dev->ieee80211_ptr->iftype != NL80211_IFTYPE_MESH_POINT &&
4448 dev->ieee80211_ptr->iftype != NL80211_IFTYPE_P2P_GO) 4449 dev->ieee80211_ptr->iftype != NL80211_IFTYPE_P2P_GO)
4449 return -EOPNOTSUPP; 4450 return -EOPNOTSUPP;
4450 4451
@@ -4485,6 +4486,7 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
4485 dev->ieee80211_ptr->iftype != NL80211_IFTYPE_P2P_CLIENT && 4486 dev->ieee80211_ptr->iftype != NL80211_IFTYPE_P2P_CLIENT &&
4486 dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP && 4487 dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP &&
4487 dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP_VLAN && 4488 dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP_VLAN &&
4489 dev->ieee80211_ptr->iftype != NL80211_IFTYPE_MESH_POINT &&
4488 dev->ieee80211_ptr->iftype != NL80211_IFTYPE_P2P_GO) 4490 dev->ieee80211_ptr->iftype != NL80211_IFTYPE_P2P_GO)
4489 return -EOPNOTSUPP; 4491 return -EOPNOTSUPP;
4490 4492