cfg80211: allow user space to query the operating frequency
PATCH v2 1/1 cfg80211: allow user space to query the operating frequency
Signed-off-by Felix Fietkau <[email protected]>
---
net/wireless/core.h +1 -0
@@ -75,6 +75,7 @@ struct cfg80211_registered_device {/* current channel */ struct ieee80211_channel *channel; +enum nl80211_channel_type channel_type;/* must be last because of the way we do wiphy_priv(), * and it should at least be aligned to NETDEV_ALIGN */
net/wireless/chan.c +1 -0
@@ -97,6 +97,7 @@ int rdev_set_freq(struct cfg80211_registreturn result; rdev->channel = chan; + rdev->channel_type = channel_type;return 0 ; }
net/wireless/nl80211.c +5 -0
@@ -881,6 +881,11 @@ static int nl80211_send_iface(struct sk_NLA_PUT_U32 (msg,NL80211_ATTR_WIPHY , rdev->wiphy_idx);NLA_PUT_STRING (msg,NL80211_ATTR_IFNAME , dev->name);NLA_PUT_U32 (msg,NL80211_ATTR_IFTYPE , dev->ieee80211_ptr->iftype); +if (rdev->channel) { +NLA_PUT_U32 (msg,NL80211_ATTR_WIPHY_FREQ , rdev->channel->center_freq); +NLA_PUT_U32 (msg,NL80211_ATTR_WIPHY_CHANNEL_TYPE , rdev->channel_type); + } + NLA_PUT_U32(msg, NL80211_ATTR_GENERATION, rdev->devlist_generation ^
Johannes Berg
maintainernet/wireless/nl80211.c static int nl80211_send_iface(struct sk_ · line 887
Quoted 6 lines · Felix Fietkau
(quoted diff) +2
-0+ if (rdev->channel) { + NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ,
rdev->channel->center_freq);(quoted diff) +1
-0+ NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE,
rdev->channel_type);net/wireless/nl80211.c +1
-0+ }
This patch won't even work the way you want it to.
johannes