[PATCH] hostapd: Update supported channel width set of HT capability

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

 



>From c81b2a34a223fb8b6b0e00b57c0cbd50fa706dc7 Mon Sep 17 00:00:00 2001

From: peterhuang <peterhuang@xxxxxxxxxxx>

Date: Wed, 11 Aug 2021 20:23:40 +0800

Subject: [PATCH] hostapd: Update supported channel width set of HT capability



Need to update supported channel width set after channel switch done.

Otherwise, it would be old setting.



Signed-off-by: peterhuang <peter801117.cs03g@xxxxxxxxxxxxxx>

---

src/ap/drv_callbacks.c |  5 +++++

src/ap/hostapd.c       | 14 ++++++++++++++

2 files changed, 19 insertions(+)



diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c

index ec5abf166..31f6a1359 100644

--- a/src/ap/drv_callbacks.c

+++ b/src/ap/drv_callbacks.c

@@ -957,6 +957,11 @@ void hostapd_event_ch_switch(struct hostapd_data
*hapd, int freq, int ht,

      hapd->iconf->ch_switch_vht_config = 0;

      hapd->iconf->ch_switch_he_config = 0;



+      if (width > CHAN_WIDTH_20)

+              hapd->iconf->ht_capab |= HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET;

+      else

+              hapd->iconf->ht_capab &= ~HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET;

+

      hapd->iconf->secondary_channel = offset;

      hostapd_set_oper_chwidth(hapd->iconf, chwidth);

      hostapd_set_oper_centr_freq_seg0_idx(hapd->iconf, seg0_idx);

diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c

index 913a8e29e..a8f1bf937 100644

--- a/src/ap/hostapd.c

+++ b/src/ap/hostapd.c

@@ -3461,6 +3461,20 @@ static int hostapd_change_config_freq(struct
hostapd_data *hapd,

                                  NULL))

              return -1;



+      switch (params->bandwidth) {

+      case 0:

+      case 20:

+              conf->ht_capab &= ~HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET;

+              break;

+      case 40:

+      case 80:

+      case 160:

+              conf->ht_capab |= HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET;

+              break;

+      default:

+              return -1;

+      }

+

      switch (params->bandwidth) {

      case 0:

      case 20:

--

2.25.1

_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux