// SPDX-License-Identifier: GPL-2.0/* * This file contains helper code to handle channel * settings and keeping track of what is possible at * any point in time. * * Copyright 2009 Johannes Berg <johannes@sipsolutions.net> * Copyright 2013-2014 Intel Mobile Communications GmbH * Copyright 2018-2022 Intel Corporation */#include<linux/export.h>#include<linux/bitfield.h>#include<net/cfg80211.h>#include"core.h"#include"rdev-ops.h"staticboolcfg80211_valid_60g_freq(u32freq){returnfreq>=58320&&freq<=70200;}voidcfg80211_chandef_create(structcfg80211_chan_def*chandef,structieee80211_channel*chan,enumnl80211_channel_typechan_type){if(WARN_ON(!chan))return;chandef->chan=chan;chandef->freq1_offset=chan->freq_offset;chandef->center_freq2=0;chandef->edmg.bw_config=0;chandef->edmg.channels=0;switch(chan_type){caseNL80211_CHAN_NO_HT:chandef->width=NL80211_CHAN_WIDTH_20_NOHT;chandef->center_freq1=chan->center_freq;break;caseNL80211_CHAN_HT20:chandef->width=NL80211_CHAN_WIDTH_20;chandef->center_freq1=chan->center_freq;break;caseNL80211_CHAN_HT40PLUS:chandef->width=NL80211_CHAN_WIDTH_40;chandef->center_freq1=chan->center_freq+10;break;caseNL80211_CHAN_HT40MINUS:chandef->width=NL80211_CHAN_WIDTH_40;chandef->center_freq1=chan->