From 7882621ca91e4a22a7d1a8b11b7f187fbdc47c3b Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Fri, 25 Feb 2022 09:58:05 -0800 Subject: [PATCH] wiphy: add 6Ghz support --- src/wiphy.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/wiphy.c b/src/wiphy.c index b6b0f563..a52d0941 100644 --- a/src/wiphy.c +++ b/src/wiphy.c @@ -106,6 +106,7 @@ struct wiphy { struct scan_freq_set *supported_freqs; struct band *band_2g; struct band *band_5g; + struct band *band_6g; char *model_str; char *vendor_str; char *driver_str; @@ -350,6 +351,11 @@ static void wiphy_free(void *data) wiphy->band_5g = NULL; } + if (wiphy->band_6g) { + band_free(wiphy->band_6g); + wiphy->band_6g = NULL; + } + scan_freq_set_free(wiphy->supported_freqs); watchlist_destroy(&wiphy->state_watches); l_free(wiphy->model_str); @@ -436,6 +442,9 @@ uint32_t wiphy_get_supported_bands(struct wiphy *wiphy) if (wiphy->band_5g) bands |= BAND_FREQ_5_GHZ; + if (wiphy->band_6g) + bands |= BAND_FREQ_6_GHZ; + return bands; } @@ -739,6 +748,9 @@ const uint8_t *wiphy_get_supported_rates(struct wiphy *wiphy, unsigned int band, case NL80211_BAND_5GHZ: bandp = wiphy->band_5g; break; + case NL80211_BAND_6GHZ: + bandp = wiphy->band_6g; + break; default: return NULL; } @@ -789,6 +801,9 @@ int wiphy_estimate_data_rate(struct wiphy *wiphy, case BAND_FREQ_5_GHZ: bandp = wiphy->band_5g; break; + case BAND_FREQ_6_GHZ: + bandp = wiphy->band_6g; + break; default: return -ENOTSUP; } @@ -979,6 +994,9 @@ static void wiphy_print_basic_info(struct wiphy *wiphy) if (wiphy->band_5g) wiphy_print_band_info(wiphy->band_5g, "5Ghz Band"); + if (wiphy->band_6g) + wiphy_print_band_info(wiphy->band_6g, "6GHz Band"); + if (wiphy->supported_ciphers) { int len = 0; @@ -1193,6 +1211,9 @@ static void parse_supported_bands(struct wiphy *wiphy, case NL80211_BAND_5GHZ: bandp = &wiphy->band_5g; break; + case NL80211_BAND_6GHZ: + bandp = &wiphy->band_6g; + break; default: continue; }