Skip to content

Commit 2e165b8

Browse files
Michal Kaziorjmberg-intel
authored andcommitted
cfg80211/mac80211: remove .get_channel
We do not need it anymore since cfg80211 tracks monitor channel and monitor channel type. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent a69b40a commit 2e165b8

4 files changed

Lines changed: 7 additions & 34 deletions

File tree

‎include/net/cfg80211.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1501,9 +1501,6 @@ struct cfg80211_gtk_rekey_data {
15011501
* be stored for when a monitor interface becomes active.
15021502
* @set_monitor_enabled: Notify driver that there are only monitor
15031503
* interfaces running.
1504-
* @get_channel: Get the current operating channel, should return %NULL if
1505-
* there's no single defined operating channel if for example the
1506-
* device implements channel hopping for multi-channel virtual interfaces.
15071504
*
15081505
* @scan: Request to do a scan. If returning zero, the scan request is given
15091506
* the driver, and will be valid until passed to cfg80211_scan_done().
@@ -1810,9 +1807,6 @@ struct cfg80211_ops {
18101807
struct net_device *dev,
18111808
u16 noack_map);
18121809

1813-
struct ieee80211_channel *(*get_channel)(struct wiphy *wiphy,
1814-
enum nl80211_channel_type *type);
1815-
18161810
int (*get_et_sset_count)(struct wiphy *wiphy,
18171811
struct net_device *dev, int sset);
18181812
void (*get_et_stats)(struct wiphy *wiphy, struct net_device *dev,

‎net/mac80211/cfg.c‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2980,16 +2980,6 @@ static int ieee80211_probe_client(struct wiphy *wiphy, struct net_device *dev,
29802980
return 0;
29812981
}
29822982

2983-
static struct ieee80211_channel *
2984-
ieee80211_wiphy_get_channel(struct wiphy *wiphy,
2985-
enum nl80211_channel_type *type)
2986-
{
2987-
struct ieee80211_local *local = wiphy_priv(wiphy);
2988-
2989-
*type = local->_oper_channel_type;
2990-
return local->oper_channel;
2991-
}
2992-
29932983
static void ieee80211_set_monitor_enabled(struct wiphy *wiphy, bool enabled)
29942984
{
29952985
struct ieee80211_local *local = wiphy_priv(wiphy);
@@ -3073,7 +3063,6 @@ struct cfg80211_ops mac80211_config_ops = {
30733063
.tdls_oper = ieee80211_tdls_oper,
30743064
.tdls_mgmt = ieee80211_tdls_mgmt,
30753065
.probe_client = ieee80211_probe_client,
3076-
.get_channel = ieee80211_wiphy_get_channel,
30773066
.set_noack_map = ieee80211_set_noack_map,
30783067
.set_monitor_enabled = ieee80211_set_monitor_enabled,
30793068
#ifdef CONFIG_PM

‎net/wireless/nl80211.c‎

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1689,16 +1689,11 @@ static int nl80211_send_iface(struct sk_buff *msg, u32 pid, u32 seq, int flags,
16891689
(cfg80211_rdev_list_generation << 2)))
16901690
goto nla_put_failure;
16911691

1692-
if (rdev->ops->get_channel) {
1693-
struct ieee80211_channel *chan;
1694-
enum nl80211_channel_type channel_type;
1695-
1696-
chan = rdev->ops->get_channel(&rdev->wiphy, &channel_type);
1697-
if (chan &&
1698-
(nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ,
1699-
chan->center_freq) ||
1700-
nla_put_u32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE,
1701-
channel_type)))
1692+
if (rdev->monitor_channel) {
1693+
if (nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ,
1694+
rdev->monitor_channel->center_freq) ||
1695+
nla_put_u32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE,
1696+
rdev->monitor_channel_type))
17021697
goto nla_put_failure;
17031698
}
17041699

‎net/wireless/wext-compat.c‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -827,22 +827,17 @@ static int cfg80211_wext_giwfreq(struct net_device *dev,
827827
{
828828
struct wireless_dev *wdev = dev->ieee80211_ptr;
829829
struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
830-
struct ieee80211_channel *chan;
831-
enum nl80211_channel_type channel_type;
832830

833831
switch (wdev->iftype) {
834832
case NL80211_IFTYPE_STATION:
835833
return cfg80211_mgd_wext_giwfreq(dev, info, freq, extra);
836834
case NL80211_IFTYPE_ADHOC:
837835
return cfg80211_ibss_wext_giwfreq(dev, info, freq, extra);
838836
case NL80211_IFTYPE_MONITOR:
839-
if (!rdev->ops->get_channel)
837+
if (!rdev->monitor_channel)
840838
return -EINVAL;
841839

842-
chan = rdev->ops->get_channel(wdev->wiphy, &channel_type);
843-
if (!chan)
844-
return -EINVAL;
845-
freq->m = chan->center_freq;
840+
freq->m = rdev->monitor_channel->center_freq;
846841
freq->e = 6;
847842
return 0;
848843
default:

0 commit comments

Comments
 (0)