2016-02-26 21:14:45

by Felix Fietkau

[permalink] [raw]
Subject: [PATCH] mac80211: remove wdev/vif conversion functions

Nothing uses them

Signed-off-by: Felix Fietkau <[email protected]>
---
include/net/mac80211.h | 26 --------------------------
net/mac80211/util.c | 28 ----------------------------
2 files changed, 54 deletions(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 0c09da3..e11d751 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1439,32 +1439,6 @@ static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
}

/**
- * wdev_to_ieee80211_vif - return a vif struct from a wdev
- * @wdev: the wdev to get the vif for
- *
- * This can be used by mac80211 drivers with direct cfg80211 APIs
- * (like the vendor commands) that get a wdev.
- *
- * Note that this function may return %NULL if the given wdev isn't
- * associated with a vif that the driver knows about (e.g. monitor
- * or AP_VLAN interfaces.)
- */
-struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev);
-
-/**
- * ieee80211_vif_to_wdev - return a wdev struct from a vif
- * @vif: the vif to get the wdev for
- *
- * This can be used by mac80211 drivers with direct cfg80211 APIs
- * (like the vendor commands) that needs to get the wdev for a vif.
- *
- * Note that this function may return %NULL if the given wdev isn't
- * associated with a vif that the driver knows about (e.g. monitor
- * or AP_VLAN interfaces.)
- */
-struct wireless_dev *ieee80211_vif_to_wdev(struct ieee80211_vif *vif);
-
-/**
* enum ieee80211_key_flags - key flags
*
* These flags are used for communication about keys between the driver
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 89f7179..4482625 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -694,34 +694,6 @@ void ieee80211_iterate_stations_atomic(struct ieee80211_hw *hw,
}
EXPORT_SYMBOL_GPL(ieee80211_iterate_stations_atomic);

-struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev)
-{
- struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
-
- if (!ieee80211_sdata_running(sdata) ||
- !(sdata->flags & IEEE80211_SDATA_IN_DRIVER))
- return NULL;
- return &sdata->vif;
-}
-EXPORT_SYMBOL_GPL(wdev_to_ieee80211_vif);
-
-struct wireless_dev *ieee80211_vif_to_wdev(struct ieee80211_vif *vif)
-{
- struct ieee80211_sub_if_data *sdata;
-
- if (!vif)
- return NULL;
-
- sdata = vif_to_sdata(vif);
-
- if (!ieee80211_sdata_running(sdata) ||
- !(sdata->flags & IEEE80211_SDATA_IN_DRIVER))
- return NULL;
-
- return &sdata->wdev;
-}
-EXPORT_SYMBOL_GPL(ieee80211_vif_to_wdev);
-
/*
* Nothing should have been stuffed into the workqueue during
* the suspend->resume cycle. Since we can't check each caller
--
2.2.2



2016-03-06 06:54:10

by Emmanuel Grumbach

[permalink] [raw]
Subject: Re: [PATCH] mac80211: remove wdev/vif conversion functions

On Fri, Feb 26, 2016 at 11:14 PM, Felix Fietkau <[email protected]> wrote:
> Nothing uses them

Correction: nothing *upstream* uses them *yet*. We have code that will use them.
wdev_to_ieee80211_vif was added by:

commit ad7e718c9b4f717823fd920a0103f7b0fb06183f
Author: Johannes Berg <[email protected]>
Date: Wed Nov 13 13:37:47 2013 +0100

nl80211: vendor command support


Which by design was meant to provide a pipe that may not be upstream
(at least not immediately).

>
> Signed-off-by: Felix Fietkau <[email protected]>
> ---
> include/net/mac80211.h | 26 --------------------------
> net/mac80211/util.c | 28 ----------------------------
> 2 files changed, 54 deletions(-)
>
> diff --git a/include/net/mac80211.h b/include/net/mac80211.h
> index 0c09da3..e11d751 100644
> --- a/include/net/mac80211.h
> +++ b/include/net/mac80211.h
> @@ -1439,32 +1439,6 @@ static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
> }
>
> /**
> - * wdev_to_ieee80211_vif - return a vif struct from a wdev
> - * @wdev: the wdev to get the vif for
> - *
> - * This can be used by mac80211 drivers with direct cfg80211 APIs
> - * (like the vendor commands) that get a wdev.
> - *
> - * Note that this function may return %NULL if the given wdev isn't
> - * associated with a vif that the driver knows about (e.g. monitor
> - * or AP_VLAN interfaces.)
> - */
> -struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev);
> -
> -/**
> - * ieee80211_vif_to_wdev - return a wdev struct from a vif
> - * @vif: the vif to get the wdev for
> - *
> - * This can be used by mac80211 drivers with direct cfg80211 APIs
> - * (like the vendor commands) that needs to get the wdev for a vif.
> - *
> - * Note that this function may return %NULL if the given wdev isn't
> - * associated with a vif that the driver knows about (e.g. monitor
> - * or AP_VLAN interfaces.)
> - */
> -struct wireless_dev *ieee80211_vif_to_wdev(struct ieee80211_vif *vif);
> -
> -/**
> * enum ieee80211_key_flags - key flags
> *
> * These flags are used for communication about keys between the driver
> diff --git a/net/mac80211/util.c b/net/mac80211/util.c
> index 89f7179..4482625 100644
> --- a/net/mac80211/util.c
> +++ b/net/mac80211/util.c
> @@ -694,34 +694,6 @@ void ieee80211_iterate_stations_atomic(struct ieee80211_hw *hw,
> }
> EXPORT_SYMBOL_GPL(ieee80211_iterate_stations_atomic);
>
> -struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev)
> -{
> - struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
> -
> - if (!ieee80211_sdata_running(sdata) ||
> - !(sdata->flags & IEEE80211_SDATA_IN_DRIVER))
> - return NULL;
> - return &sdata->vif;
> -}
> -EXPORT_SYMBOL_GPL(wdev_to_ieee80211_vif);
> -
> -struct wireless_dev *ieee80211_vif_to_wdev(struct ieee80211_vif *vif)
> -{
> - struct ieee80211_sub_if_data *sdata;
> -
> - if (!vif)
> - return NULL;
> -
> - sdata = vif_to_sdata(vif);
> -
> - if (!ieee80211_sdata_running(sdata) ||
> - !(sdata->flags & IEEE80211_SDATA_IN_DRIVER))
> - return NULL;
> -
> - return &sdata->wdev;
> -}
> -EXPORT_SYMBOL_GPL(ieee80211_vif_to_wdev);
> -
> /*
> * Nothing should have been stuffed into the workqueue during
> * the suspend->resume cycle. Since we can't check each caller
> --
> 2.2.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html