Search Linux Wireless

RE: [PATCH v2 3/6] wifi: mt76: mt7925: update the channel usage when the regd domain changed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mingyen Hsieh <mingyen.hsieh@xxxxxxxxxxxx> wrote:

[...]

> +static void
> +mt7925_regd_channel_update(struct wiphy *wiphy, struct mt792x_dev *dev)
> +{
> +#define IS_UNII_INVALID(idx, sfreq, efreq) \
> +       (!(dev->phy.clc_chan_conf & BIT(idx)) && (cfreq) >= (sfreq) && (cfreq) <= (efreq))

Implicitly using 'cfreq' would be missing something by reviewers.
How about adding it as an argument of macro?

> +       struct ieee80211_supported_band *sband;
> +       struct mt76_dev *mdev = &dev->mt76;
> +       struct ieee80211_channel *ch;
> +       int i, cfreq;
> +
> +       sband = wiphy->bands[NL80211_BAND_5GHZ];
> +       if (!sband)
> +               return;
> +
> +       for (i = 0; i < sband->n_channels; i++) {
> +               ch = &sband->channels[i];
> +               cfreq = ch->center_freq;
> +
> +               /* UNII-4 */
> +               if (IS_UNII_INVALID(0, 5845, 5925))
> +                       ch->flags |= IEEE80211_CHAN_DISABLED;
> +       }
> +
> +       sband = wiphy->bands[NL80211_BAND_6GHZ];
> +       if (!sband)
> +               return;
> +
> +       for (i = 0; i < sband->n_channels; i++) {
> +               ch = &sband->channels[i];
> +               cfreq = ch->center_freq;
> +
> +               /* UNII-5/6/7/8 */
> +               if (IS_UNII_INVALID(1, 5925, 6425) ||
> +                   IS_UNII_INVALID(2, 6425, 6525) ||
> +                   IS_UNII_INVALID(3, 6525, 6875) ||
> +                   IS_UNII_INVALID(4, 6875, 7125))
> +                       ch->flags |= IEEE80211_CHAN_DISABLED;
> +       }
> +}
> +

[...]






[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux