nl80211: add "band" to iwinfo_freqlist_entry
authorAndre Heider <a.heider@gmail.com>
Mon, 21 Nov 2022 12:48:43 +0000 (13:48 +0100)
committerChristian Marangi <ansuelsmth@gmail.com>
Fri, 20 Jan 2023 16:26:57 +0000 (17:26 +0100)
So that consumers don't have to fiddle around with mapping frequencies
to bands, which everyone seems to do a little differently.

Note: This changes the ABI.

Signed-off-by: Andre Heider <a.heider@gmail.com>
include/iwinfo.h
iwinfo_nl80211.c

index d003d2cae519df45f2b3233d763f2f37e5ccdf5d..71c4c8049823de14fa0184bdb9b0f0e733c11198 100644 (file)
@@ -271,6 +271,7 @@ struct iwinfo_txpwrlist_entry {
 };
 
 struct iwinfo_freqlist_entry {
+       uint8_t band;
        uint8_t channel;
        uint32_t mhz;
        uint8_t restricted;
index 630fdbfe8e897c5f3a5c7d957207a6b5eee46308..50caf0161fcb6e2c9f877746880db0cc1916c0a8 100644 (file)
@@ -3009,6 +3009,7 @@ static int nl80211_get_freqlist_cb(struct nl_msg *msg, void *arg)
                                            freqs[NL80211_FREQUENCY_ATTR_DISABLED])
                                                continue;
 
+                                       e->band = nl80211_get_band(band->nla_type);
                                        e->mhz = nla_get_u32(freqs[NL80211_FREQUENCY_ATTR_FREQ]);
                                        e->channel = nl80211_freq2channel(e->mhz);