.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * mac80211 - channel management |
---|
3 | 4 | */ |
---|
.. | .. |
---|
312 | 313 | |
---|
313 | 314 | lockdep_assert_held(&local->chanctx_mtx); |
---|
314 | 315 | |
---|
315 | | - /* don't optimize 5MHz, 10MHz, and radar_enabled confs */ |
---|
| 316 | + /* don't optimize non-20MHz based and radar_enabled confs */ |
---|
316 | 317 | if (ctx->conf.def.width == NL80211_CHAN_WIDTH_5 || |
---|
317 | 318 | ctx->conf.def.width == NL80211_CHAN_WIDTH_10 || |
---|
| 319 | + ctx->conf.def.width == NL80211_CHAN_WIDTH_1 || |
---|
| 320 | + ctx->conf.def.width == NL80211_CHAN_WIDTH_2 || |
---|
| 321 | + ctx->conf.def.width == NL80211_CHAN_WIDTH_4 || |
---|
| 322 | + ctx->conf.def.width == NL80211_CHAN_WIDTH_8 || |
---|
| 323 | + ctx->conf.def.width == NL80211_CHAN_WIDTH_16 || |
---|
318 | 324 | ctx->conf.radar_enabled) { |
---|
319 | 325 | ctx->conf.min_def = ctx->conf.def; |
---|
320 | 326 | return; |
---|
.. | .. |
---|
530 | 536 | |
---|
531 | 537 | if (!local->use_chanctx) { |
---|
532 | 538 | struct cfg80211_chan_def *chandef = &local->_oper_chandef; |
---|
533 | | - chandef->width = NL80211_CHAN_WIDTH_20_NOHT; |
---|
| 539 | + /* S1G doesn't have 20MHz, so get the correct width for the |
---|
| 540 | + * current channel. |
---|
| 541 | + */ |
---|
| 542 | + if (chandef->chan->band == NL80211_BAND_S1GHZ) |
---|
| 543 | + chandef->width = |
---|
| 544 | + ieee80211_s1g_channel_width(chandef->chan); |
---|
| 545 | + else |
---|
| 546 | + chandef->width = NL80211_CHAN_WIDTH_20_NOHT; |
---|
534 | 547 | chandef->center_freq1 = chandef->chan->center_freq; |
---|
| 548 | + chandef->freq1_offset = chandef->chan->freq_offset; |
---|
535 | 549 | chandef->center_freq2 = 0; |
---|
536 | 550 | |
---|
537 | 551 | /* NOTE: Disabling radar is only valid here for |
---|
.. | .. |
---|
741 | 755 | default: |
---|
742 | 756 | WARN_ONCE(1, "Invalid SMPS mode %d\n", |
---|
743 | 757 | sdata->smps_mode); |
---|
744 | | - /* fall through */ |
---|
| 758 | + fallthrough; |
---|
745 | 759 | case IEEE80211_SMPS_OFF: |
---|
746 | 760 | needed_static = sdata->needed_rx_chains; |
---|
747 | 761 | needed_dynamic = sdata->needed_rx_chains; |
---|
.. | .. |
---|
1638 | 1652 | |
---|
1639 | 1653 | if (new_ctx->replace_state == IEEE80211_CHANCTX_REPLACE_NONE) { |
---|
1640 | 1654 | if (old_ctx) |
---|
1641 | | - err = ieee80211_vif_use_reserved_reassign(sdata); |
---|
1642 | | - else |
---|
1643 | | - err = ieee80211_vif_use_reserved_assign(sdata); |
---|
| 1655 | + return ieee80211_vif_use_reserved_reassign(sdata); |
---|
1644 | 1656 | |
---|
1645 | | - if (err) |
---|
1646 | | - return err; |
---|
| 1657 | + return ieee80211_vif_use_reserved_assign(sdata); |
---|
1647 | 1658 | } |
---|
1648 | 1659 | |
---|
1649 | 1660 | /* |
---|