[PATCH v9 0/7] Introduce Automated Frequency Coordination (AFC) support
Allen Ye (葉芷勳)
Allen.Ye at mediatek.com
Wed Jan 28 00:10:56 PST 2026
On Mon, 2026-01-26 at 23:12 +0200, Jouni Malinen wrote:
>
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>
>
> On Mon, Dec 01, 2025 at 07:10:35PM +0800, Allen Ye wrote:
> > This patch series introduces Automated Frequency Coordination (AFC)
> > support
> > for Standard Power Devices (SPDs) operating in the 6GHz UNII-5 and
> > UNII-7
> > bands. AFC is a regulatory requirement for SPDs to determine a list
> > of
> > available channels and their permissible power levels.
> >
> > The implementation introduces a new standalone daemon, afcd, to
> > manage
> > communication with the AFC server. A client within hostapd then
> > interacts
> > with afcd via a Unix socket to fetch spectrum availability and
> > update AP
> > parameters accordingly. The series also includes hwsim tests for
> > validation.
>
> > Changes since v8:
> > - rebase on top of hostapd main branch
>
> There were a couple of conflicts with the current snapshot, so it is
> possible that something went wrong when I merged the conflicts.
> However,
> I don't think all of these would be caused by that.. In any case, I
> cannot compile this due to following warnings or errors:
>
Hi Jouni,
Thank you for your reply and for testing the patch series.
I have tested these patches with the latest hostapd version. I
encountered conflicts in ctrl_iface.c and hw_features.c, which I
resolved locally. After that, the only issue I saw was the
Wsign-compare warnings.
Regarding the Wsign-compare warnings, I apologize for missing these.
In my development environment, this warning does not appear unless I
manually add it to the compile flags, so I overlooked it. If needed, I
can address these type issues in the next patch series.
> config_file.c: In function ‘hostapd_afc_parse_cert_ids’:
> config_file.c:1323:23: warning: comparison of integer expressions of
> different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
> 1323 | for (i = 0; i < conf->afc.n_cert_ids; i++) {
> | ^
> ../src/ap/afc.c: In function ‘hostapd_afc_build_location_request’:
> ../src/ap/afc.c:87:24: warning: comparison of integer expressions of
> different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
> 87 | i < iconf-
> >afc.location.n_linear_polygon_data; i++) {
> | ^
> ../src/ap/afc.c:125:24: warning: comparison of integer expressions of
> different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
> 125 | i < iconf-
> >afc.location.n_radial_polygon_data; i++) {
> | ^
> ../src/ap/afc.c: In function ‘hostapd_afc_build_req_chan_list’:
> ../src/ap/afc.c:285:23: warning: comparison of integer expressions of
> different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
> 285 | for (i = 0; i < iconf->afc.n_op_class; i++) {
> | ^
> ../src/ap/afc.c: In function ‘hostapd_afc_build_request’:
> ../src/ap/afc.c:352:31: error: ‘struct <anonymous>’ has no member
> named ‘id’
> 352 | if (iconf->afc.request.id) {
> | ^
> ../src/ap/afc.c:353:68: error: ‘struct <anonymous>’ has no member
> named ‘id’
> 353 | str_obj = json_object_new_string(iconf-
> >afc.request.id);
>
> |
> ^
About these struct <anonymous>’ has no member named ‘id’ errors.
The changes seem from v8 patch set. In v9, the request id in
hostapd_config was removed and replaced with a random number. There
might have been an issue when merging the v9-5 patch. Please make
sure you are using the latest v9 changes.
> ../src/ap/afc.c:378:23: warning: comparison of integer expressions of
> different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
> 378 | for (i = 0; i < iconf->afc.n_cert_ids; i++) {
> | ^
> ../src/ap/afc.c:419:31: warning: comparison of integer expressions of
> different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
> 419 | for (i = 0; i < iconf->afc.n_freq_range; i++)
> {
> | ^
> ../src/ap/afc.c: In function ‘hostad_afc_parse_available_freq_info’:
> ../src/ap/afc.c:471:23: warning: comparison of integer expressions of
> different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-
> Wsign-compare]
> 471 | for (i = 0; i < json_object_array_length(obj); i++) {
> | ^
> ../src/ap/afc.c: In function ‘hostad_afc_parse_available_chan_info’:
> ../src/ap/afc.c:585:23: warning: comparison of integer expressions of
> different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-
> Wsign-compare]
> 585 | for (i = 0; i < json_object_array_length(obj); i++) {
> | ^
> ../src/ap/afc.c:609:25: warning: comparison of integer expressions of
> different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-
> Wsign-compare]
> 609 | ch <
> json_object_array_length(chan_cfi_obj); ch++) {
> | ^
> ../src/ap/afc.c: In function ‘hostapd_afc_parse_reply’:
> ../src/ap/afc.c:689:23: warning: comparison of integer expressions of
> different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-
> Wsign-compare]
> 689 | for (i = 0; i < json_object_array_length(reply_obj);
> i++) {
> | ^
> ../src/ap/afc.c:708:39: error: ‘struct <anonymous>’ has no member
> named ‘id’
> 708 | if (iconf->afc.request.id &&
> | ^
> In file included from /Git/hostap/src/utils/common.h:12,
> from ../src/ap/afc.c:14:
> ../src/ap/afc.c:709:49: error: ‘struct <anonymous>’ has no member
> named ‘id’
> 709 | os_strcmp(iconf->afc.request.id,
> | ^
> /Git/hostap/src/utils/os.h:556:35: note: in definition of macro
> ‘os_strcmp’
> 556 | #define os_strcmp(s1, s2) strcmp((s1), (s2))
> | ^~
The same errors here.
> ../src/ap/afc.c:724:31: warning: comparison of integer expressions of
> different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
> 724 | for (j = 0; j < iconf->afc.n_cert_ids; j++) {
> | ^
> ../src/ap/afc.c:730:23: warning: comparison of integer expressions of
> different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
> 730 | if (j == iconf->afc.n_cert_ids) {
> | ^~
> ../src/ap/afc.c: In function ‘hostap_afc_disable_channels’:
> ../src/ap/afc.c:1087:31: warning: comparison of integer expressions
> of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
> 1087 | for (j = 0; j < iface->afc.num_freq_range;
> j++) {
> | ^
> ../src/ap/afc.c:1093:23: warning: comparison of integer expressions
> of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
> 1093 | if (j != iface->afc.num_freq_range)
> | ^~
> ../src/ap/afc.c:1096:31: warning: comparison of integer expressions
> of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
> 1096 | for (j = 0; j < iface->afc.num_chan_info;
> j++) {
> | ^
> ../src/ap/afc.c:1101:23: warning: comparison of integer expressions
> of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
> 1101 | if (j != iface->afc.num_chan_info)
> | ^~
> ../src/ap/afc.c: In function ‘hostap_afc_get_chan_max_eirp_power’:
> ../src/ap/afc.c:1124:31: warning: comparison of integer expressions
> of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
> 1124 | for (i = 0; i < iface->afc.num_freq_range;
> i++) {
> | ^
> ../src/ap/afc.c:1135:31: warning: comparison of integer expressions
> of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
> 1135 | for (i = 0; i < iface->afc.num_chan_info;
> i++) {
> | ^
> ../src/ap/afc.c:1143:47: warning: comparison of integer expressions
> of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-
> compare]
> 1143 | for (j = 0; j < ARRAY_SIZE(c-
> >power); j++)
> | ^
> ctrl_iface.c:3965:1: warning: ‘hostapd_cli_cmd_afc_send_request’
> defined but not used [-Wunused-function]
> 3965 | hostapd_cli_cmd_afc_send_request(struct hostapd_data *hapd,
> char *cmd,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ctrl_iface.c:3954:1: warning: ‘hostapd_cli_cmd_afc_get_response’
> defined but not used [-Wunused-function]
> 3954 | hostapd_cli_cmd_afc_get_response(struct hostapd_data *hapd,
> char *cmd,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ctrl_iface.c:3942:1: warning: ‘hostapd_cli_cmd_afc_get_request’
> defined but not used [-Wunused-function]
> 3942 | hostapd_cli_cmd_afc_get_request(struct hostapd_data *hapd,
> char *cmd,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
About the Wunused-function warnings, I believe some related logic may
have been accidentally changed during the merge process. Please check
if hostapd_ctrl_iface_receive_process is still using the functions, and
verify the scope of the related
flags.
Thanks,
Allen
> /usr/bin/ld: /Git/hostap/build/hostapd/src/ap/hostapd.o: in function
> `hostapd_cleanup_iface':
> /Git/hostap/hostapd/../src/ap/hostapd.c:763:(.text+0x309d): undefined
> reference to `hostapd_afc_stop'
> /usr/bin/ld: /Git/hostap/build/hostapd/src/ap/hostapd.o: in function
> `hostapd_interface_deinit':
> /Git/hostap/hostapd/../src/ap/hostapd.c:3054:(.text+0x5152):
> undefined reference to `hostapd_afc_stop'
> /usr/bin/ld: /Git/hostap/build/hostapd/src/ap/hostapd.o: in function
> `hostapd_setup_interface_complete_sync':
> /Git/hostap/hostapd/../src/ap/hostapd.c:2656:(.text+0x6053):
> undefined reference to `hostapd_afc_handle_request'
> /usr/bin/ld: /Git/hostap/build/hostapd/src/ap/hw_features.o: in
> function `hostapd_get_hw_features':
> /Git/hostap/hostapd/../src/ap/hw_features.c:160:(.text+0x2483):
> undefined reference to `hostap_afc_disable_channels'
> /usr/bin/ld:
> /Git/hostap/hostapd/../src/ap/hw_features.c:160:(.text+0x276e):
> undefined reference to `hostap_afc_disable_channels'
>
> --
> Jouni Malinen PGP id
> EFC895FA
More information about the Hostap
mailing list