lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8f133266a906c5b57f3294b71c7e5bae57298ad1.camel@sipsolutions.net>
Date: Fri, 16 May 2025 09:52:27 +0200
From: Johannes Berg <johannes@...solutions.net>
To: Raj Kumar Bhagat <quic_rajkbhag@...cinc.com>
Cc: linux-wireless@...r.kernel.org, linux-kernel@...r.kernel.org, 
 Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@....qualcomm.com>
Subject: Re: [PATCH wireless-next 1/3] wifi: cfg80211: Add utility API to
 get radio index from channel

On Fri, 2025-05-16 at 09:51 +0200, Johannes Berg wrote:
> On Wed, 2025-05-14 at 16:58 +0530, Raj Kumar Bhagat wrote:
> > 
> > +int cfg80211_get_radio_idx_by_chan(struct wiphy *wiphy,
> > +				   const struct ieee80211_channel *chan)
> > +{
> > +	const struct wiphy_radio *radio;
> > +	int i, j;
> > +	u32 freq;
> > +
> > +	if (!chan)
> > +		return -EINVAL;
> > +
> > +	freq = ieee80211_channel_to_khz(chan);
> > +	for (i = 0; i < wiphy->n_radio; i++) {
> > +		radio = &wiphy->radio[i];
> > +		for (j = 0; j < radio->n_freq_range; j++) {
> > +			if (freq >= radio->freq_range[j].start_freq &&
> > +			    freq <= radio->freq_range[j].end_freq)
> > +				return i;
> > 
> 
> I believe we also discussed this in the past elsewhere, but I don't
> think the the >= and <= can simultaneously be wrong. If the frequency

"simultaneously be correct". I meant "correct", not "wrong"...

johannes

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ