summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorRajkumar Manoharan <rmanohar@codeaurora.org>2019-04-11 16:47:26 -0400
committerJohannes Berg <johannes.berg@intel.com>2019-04-26 07:02:11 -0400
commit8828f81ad4a2f4e89ebe6e7793c06ed767c31d53 (patch)
tree71415b59b1233bbca345250bcbdc622ba99fdc47 /net
parent060167729a78d626abaee1a0ebb64b252374426e (diff)
mac80211: probe unexercised mesh links
The requirement for mesh link metric refreshing, is that from one mesh point we be able to send some data frames to other mesh points which are not currently selected as a primary traffic path, but which are only 1 hop away. The absence of the primary path to the chosen node makes it necessary to apply some form of marking on a chosen packet stream so that the packets can be properly steered to the selected node for testing, and not by the regular mesh path lookup. Tested-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org> Signed-off-by: Rajkumar Manoharan <rmanohar@codeaurora.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/cfg.c1
-rw-r--r--net/mac80211/ieee80211_i.h2
-rw-r--r--net/mac80211/mesh_hwmp.c4
-rw-r--r--net/mac80211/tx.c36
4 files changed, 43 insertions, 0 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index ba6e4080d63d..52e6a091b7e4 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -4035,4 +4035,5 @@ const struct cfg80211_ops mac80211_config_ops = {
4035 .get_ftm_responder_stats = ieee80211_get_ftm_responder_stats, 4035 .get_ftm_responder_stats = ieee80211_get_ftm_responder_stats,
4036 .start_pmsr = ieee80211_start_pmsr, 4036 .start_pmsr = ieee80211_start_pmsr,
4037 .abort_pmsr = ieee80211_abort_pmsr, 4037 .abort_pmsr = ieee80211_abort_pmsr,
4038 .probe_mesh_link = ieee80211_probe_mesh_link,
4038}; 4039};
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 9b0190eaff1e..073a8235ae1b 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1779,6 +1779,8 @@ void ieee80211_clear_fast_xmit(struct sta_info *sta);
1779int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev, 1779int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev,
1780 const u8 *buf, size_t len, 1780 const u8 *buf, size_t len,
1781 const u8 *dest, __be16 proto, bool unencrypted); 1781 const u8 *dest, __be16 proto, bool unencrypted);
1782int ieee80211_probe_mesh_link(struct wiphy *wiphy, struct net_device *dev,
1783 const u8 *buf, size_t len);
1782 1784
1783/* HT */ 1785/* HT */
1784void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata, 1786void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata,
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index 2c5929c0fa62..bf8e13cd5fd1 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -1135,6 +1135,10 @@ int mesh_nexthop_resolve(struct ieee80211_sub_if_data *sdata,
1135 if (ieee80211_is_qos_nullfunc(hdr->frame_control)) 1135 if (ieee80211_is_qos_nullfunc(hdr->frame_control))
1136 return 0; 1136 return 0;
1137 1137
1138 /* Allow injected packets to bypass mesh routing */
1139 if (info->control.flags & IEEE80211_TX_CTRL_SKIP_MPATH_LOOKUP)
1140 return 0;
1141
1138 if (!mesh_nexthop_lookup(sdata, skb)) 1142 if (!mesh_nexthop_lookup(sdata, skb))
1139 return 0; 1143 return 0;
1140 1144
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 9e3678675f3b..8037384fc06e 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2607,6 +2607,13 @@ static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata,
2607 goto free; 2607 goto free;
2608 } 2608 }
2609 band = chanctx_conf->def.chan->band; 2609 band = chanctx_conf->def.chan->band;
2610
2611 /* For injected frames, fill RA right away as nexthop lookup
2612 * will be skipped.
2613 */
2614 if ((ctrl_flags & IEEE80211_TX_CTRL_SKIP_MPATH_LOOKUP) &&
2615 is_zero_ether_addr(hdr.addr1))
2616 memcpy(hdr.addr1, skb->data, ETH_ALEN);
2610 break; 2617 break;
2611#endif 2618#endif
2612 case NL80211_IFTYPE_STATION: 2619 case NL80211_IFTYPE_STATION:
@@ -5091,3 +5098,32 @@ int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev,
5091 5098
5092 return 0; 5099 return 0;
5093} 5100}
5101
5102int ieee80211_probe_mesh_link(struct wiphy *wiphy, struct net_device *dev,
5103 const u8 *buf, size_t len)
5104{
5105 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
5106 struct ieee80211_local *local = sdata->local;
5107 struct sk_buff *skb;
5108
5109 skb = dev_alloc_skb(local->hw.extra_tx_headroom + len +
5110 30 + /* header size */
5111 18); /* 11s header size */
5112 if (!skb)
5113 return -ENOMEM;
5114
5115 skb_reserve(skb, local->hw.extra_tx_headroom);
5116 skb_put_data(skb, buf, len);
5117
5118 skb->dev = dev;
5119 skb->protocol = htons(ETH_P_802_3);
5120 skb_reset_network_header(skb);
5121 skb_reset_mac_header(skb);
5122
5123 local_bh_disable();
5124 __ieee80211_subif_start_xmit(skb, skb->dev, 0,
5125 IEEE80211_TX_CTRL_SKIP_MPATH_LOOKUP);
5126 local_bh_enable();
5127
5128 return 0;
5129}