|
@@ -1516,6 +1516,57 @@ static int ieee80211_dump_mpath(struct wiphy *wiphy, struct net_device *dev,
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static void mpp_set_pinfo(struct mesh_path *mpath, u8 *mpp,
|
|
|
|
+ struct mpath_info *pinfo)
|
|
|
|
+{
|
|
|
|
+ memset(pinfo, 0, sizeof(*pinfo));
|
|
|
|
+ memcpy(mpp, mpath->mpp, ETH_ALEN);
|
|
|
|
+
|
|
|
|
+ pinfo->generation = mpp_paths_generation;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static int ieee80211_get_mpp(struct wiphy *wiphy, struct net_device *dev,
|
|
|
|
+ u8 *dst, u8 *mpp, struct mpath_info *pinfo)
|
|
|
|
+
|
|
|
|
+{
|
|
|
|
+ struct ieee80211_sub_if_data *sdata;
|
|
|
|
+ struct mesh_path *mpath;
|
|
|
|
+
|
|
|
|
+ sdata = IEEE80211_DEV_TO_SUB_IF(dev);
|
|
|
|
+
|
|
|
|
+ rcu_read_lock();
|
|
|
|
+ mpath = mpp_path_lookup(sdata, dst);
|
|
|
|
+ if (!mpath) {
|
|
|
|
+ rcu_read_unlock();
|
|
|
|
+ return -ENOENT;
|
|
|
|
+ }
|
|
|
|
+ memcpy(dst, mpath->dst, ETH_ALEN);
|
|
|
|
+ mpp_set_pinfo(mpath, mpp, pinfo);
|
|
|
|
+ rcu_read_unlock();
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static int ieee80211_dump_mpp(struct wiphy *wiphy, struct net_device *dev,
|
|
|
|
+ int idx, u8 *dst, u8 *mpp,
|
|
|
|
+ struct mpath_info *pinfo)
|
|
|
|
+{
|
|
|
|
+ struct ieee80211_sub_if_data *sdata;
|
|
|
|
+ struct mesh_path *mpath;
|
|
|
|
+
|
|
|
|
+ sdata = IEEE80211_DEV_TO_SUB_IF(dev);
|
|
|
|
+
|
|
|
|
+ rcu_read_lock();
|
|
|
|
+ mpath = mpp_path_lookup_by_idx(sdata, idx);
|
|
|
|
+ if (!mpath) {
|
|
|
|
+ rcu_read_unlock();
|
|
|
|
+ return -ENOENT;
|
|
|
|
+ }
|
|
|
|
+ memcpy(dst, mpath->dst, ETH_ALEN);
|
|
|
|
+ mpp_set_pinfo(mpath, mpp, pinfo);
|
|
|
|
+ rcu_read_unlock();
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
static int ieee80211_get_mesh_config(struct wiphy *wiphy,
|
|
static int ieee80211_get_mesh_config(struct wiphy *wiphy,
|
|
struct net_device *dev,
|
|
struct net_device *dev,
|
|
struct mesh_config *conf)
|
|
struct mesh_config *conf)
|
|
@@ -3547,6 +3598,8 @@ const struct cfg80211_ops mac80211_config_ops = {
|
|
.change_mpath = ieee80211_change_mpath,
|
|
.change_mpath = ieee80211_change_mpath,
|
|
.get_mpath = ieee80211_get_mpath,
|
|
.get_mpath = ieee80211_get_mpath,
|
|
.dump_mpath = ieee80211_dump_mpath,
|
|
.dump_mpath = ieee80211_dump_mpath,
|
|
|
|
+ .get_mpp = ieee80211_get_mpp,
|
|
|
|
+ .dump_mpp = ieee80211_dump_mpp,
|
|
.update_mesh_config = ieee80211_update_mesh_config,
|
|
.update_mesh_config = ieee80211_update_mesh_config,
|
|
.get_mesh_config = ieee80211_get_mesh_config,
|
|
.get_mesh_config = ieee80211_get_mesh_config,
|
|
.join_mesh = ieee80211_join_mesh,
|
|
.join_mesh = ieee80211_join_mesh,
|