question about hostapd_set_freq_params()-src/common/hw_features_common.c

David Poole dpoole at cradlepoint.com
Tue Jul 7 14:56:26 EDT 2020


line 552 as of git sha 58b384f467224a1d43f3f947fd53e08b019cbcd3

        case CHANWIDTH_80MHZ:
                data->bandwidth = 80;
                if ((oper_chwidth == CHANWIDTH_80MHZ &&
                     center_segment1) ||
                    (oper_chwidth == CHANWIDTH_80P80MHZ &&
                     !center_segment1) ||
                    !sec_channel_offset)
                        return -1;

I'm tripping over the !sec_channel_offset check.  The sec_channel_offset is only used in 40Mhz +/- (mostly sure) but is being checked when configuring 80Mhz .

The case CHANWIDTH_160MHZ also explicity checks if sec_channel_offset is nonzero but it isn't used in the subsequent calculations.

The comments in struct hostapd_freq_params seem to indicate it's only for HT40+/-.
        /**
         * sec_channel_offset - Secondary channel offset for HT40
         *
         * 0 = HT40 disabled,
         * -1 = HT40 enabled, secondary channel below primary,
         * 1 = HT40 enabled, secondary channel above primary
         */
        int sec_channel_offset;

driver_nl80211.c uses sec_channel_offset from hostapd_freq_params but also only in setting HT 40+/-

--- my config (requires the [HT40+] to work)
driver=nl80211
interface=ath10
logger_syslog=-1
logger_syslog_level=2
logger_stdout=127
logger_stdout_level=2
ctrl_interface=/var/run/hostapd-wifi0
hw_mode=a
ssid=Magrathea
utf8_ssid=1
channel=36
uapsd_advertisement_enabled=1
dtim_period=1
beacon_int=100
wmm_enabled=1
rrm_neighbor_report=1
bss_transition=1
bss_load_update_period=50
chan_util_avg_period=600
ap_max_inactivity=300
ieee80211n=1
ht_capab=[SHORT-GI-20][SHORT-GI-40][LSIG_TXOP_PROT][HT40+]
ieee80211ac=1
vht_oper_chwidth=1
ieee80211ax=1
he_oper_chwidth=1
auth_algs=1
wpa=2
wpa_pairwise=CCMP
wpa_key_mgmt=WPA-PSK-SHA256
wpa_passphrase=goldfish2g
nas_identifier=00304422312e
bridge=primarylan1
ieee80211w=2
he_oper_centr_freq_seg0_idx=42
---


Thanks,
David

--
David Poole | Firmware Engineer | Cradlepoint | dpoole at cradlepoint.com


More information about the Hostap mailing list