[RFC 2/2 RESEND] hostapd: update TPE IE according to AFC

Arnon Meydav ameydav at maxlinear.com
Tue Feb 13 07:41:24 PST 2024


> +               err = hostap_afc_get_chan_max_eirp_power(iface, true,
> +                                                        &max_eirp_psd);
> +               if (err < 0) {
> +                       if (hapd->iconf->reg_def_cli_eirp_psd != -1)
> +                               max_eirp_psd = hapd->iconf->reg_def_cli_eirp_psd;
> +                       else
> +                               max_eirp_psd = REG_PSD_MAX_TXPOWER_FOR_DEFAULT_CLIENT * 2;
> +               }
> 
>                 eid = hostapd_add_tpe_info(eid, tx_pwr_count, tx_pwr_intrpn,
> -                                          REG_DEFAULT_CLIENT, tx_pwr);
> +                                          REG_DEFAULT_CLIENT, max_eirp_psd);
> 
>                 /* Indoor Access Point must include an additional TPE for
>                  * subordinate devices */
>                 if (he_reg_is_indoor(iconf->he_6ghz_reg_pwr_type)) {
> -                       /* TODO: Extract PSD limits from channel data */
> -                       if (hapd->iconf->reg_sub_cli_eirp_psd != -1)
> -                               tx_pwr = hapd->iconf->reg_sub_cli_eirp_psd;
> -                       else
> -                               tx_pwr = REG_PSD_MAX_TXPOWER_FOR_SUBORDINATE_CLIENT * 2;
> +                       if (err < 0) {
> +                               /* non-AFC connection */
> +                               if (hapd->iconf->reg_sub_cli_eirp_psd != -1)
> +                                       max_eirp_psd = hapd->iconf->reg_sub_cli_eirp_psd;
> +                               else
> +                                       max_eirp_psd = REG_PSD_MAX_TXPOWER_FOR_SUBORDINATE_CLIENT * 2;
> +                       }

This code will give REG_SUBORDINATE_CLIENT the same max_eirp_psd as REG_DEFAULT_CLIENT, when successfully getting results from the afc server.
Is this correct by standard, a bug, or incomplete implementation?
If incomplete, a TODO comment would be good to add, in order to have a good basis to start from.



More information about the Hostap mailing list