]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP: Advertise the LCI and civic location capabilities
authorShreedhar Parande <quic_sparande@quicinc.com>
Thu, 10 Apr 2025 15:59:41 +0000 (21:29 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 23 May 2025 13:44:10 +0000 (16:44 +0300)
Currently, for Fine Time Measurement (FTM), hostapd configures Location
Configuration Information (LCI) and civic location values without
advertising capabilities in the Extended Capabilities and RM Enabled
Capabilities elements. According to IEEE Std 802.11-2024, 11.21.6.7 (LCI
and Location Civic retrieval using FTM procedure), to use LCI and Civic
subelements in FTM frames, the AP must advertise these capabilities.

Advertise LCI and civic measurement capabilities in the Extended
Capabilities and RM Enabled Capabilities elements when these values are
available.

Signed-off-by: Shreedhar Parande <quic_sparande@quicinc.com>
hostapd/config_file.c
src/ap/ieee802_11_shared.c
src/common/ieee802_11_defs.h

index 0e35730f9d2e4326e6eb5834b986bfb133abee83..e37579efc35ecc023d28b4e4fef3aa867a54bccb 100644 (file)
@@ -4485,6 +4485,15 @@ static int hostapd_config_fill(struct hostapd_config *conf,
                        wpabuf_free(conf->lci);
                        conf->lci = NULL;
                }
+               if (conf->lci) {
+                       /* Enable LCI capability in RM Enabled Capabilities
+                        * element */
+                       bss->radio_measurements[1] |=
+                               WLAN_RRM_CAPS_LCI_MEASUREMENT;
+               } else {
+                       bss->radio_measurements[1] &=
+                               ~WLAN_RRM_CAPS_LCI_MEASUREMENT;
+               }
        } else if (os_strcmp(buf, "civic") == 0) {
                wpabuf_free(conf->civic);
                conf->civic = wpabuf_parse_bin(pos);
@@ -4492,6 +4501,15 @@ static int hostapd_config_fill(struct hostapd_config *conf,
                        wpabuf_free(conf->civic);
                        conf->civic = NULL;
                }
+               if (conf->civic) {
+                       /* Enable civic location capability in RM Enabled
+                        * Capabilities element */
+                       bss->radio_measurements[4] |=
+                               WLAN_RRM_CAPS_CIVIC_LOCATION_MEASUREMENT;
+               } else {
+                       bss->radio_measurements[4] &=
+                               ~WLAN_RRM_CAPS_CIVIC_LOCATION_MEASUREMENT;
+               }
        } else if (os_strcmp(buf, "rrm_neighbor_report") == 0) {
                if (atoi(pos))
                        bss->radio_measurements[0] |=
index 986b7b81e489b08d8bb95de655ddb373ef7011e6..e873e1c121d724525de3a2a9970f035dcc455646 100644 (file)
@@ -381,6 +381,10 @@ static void hostapd_ext_capab_byte(struct hostapd_data *hapd, u8 *pos, int idx,
                        /* Bit 13 - Collocated Interference Reporting */
                        *pos |= 0x20;
                }
+               if (hapd->iface->conf->civic)
+                       *pos |= 0x40; /* Bit 14 - Civic Location */
+               if (hapd->iface->conf->lci)
+                       *pos |= 0x80; /* Bit 15 - Geospatial Location */
                break;
        case 2: /* Bits 16-23 */
                if (hapd->conf->wnm_sleep_mode)
index 8ded386e5bf9bbdcb93654a789a53f3a0c3f020b..d029cf90573ea3f4690b0d99e0f278d24cedbc7b 100644 (file)
 #define WLAN_RRM_CAPS_LCI_MEASUREMENT BIT(4)
 /* byte 5 (out of 5) */
 #define WLAN_RRM_CAPS_FTM_RANGE_REPORT BIT(2)
+#define WLAN_RRM_CAPS_CIVIC_LOCATION_MEASUREMENT BIT(3)
 
 /*
  * IEEE Std 802.11-2020, 9.4.2.20.19 (Fine Timing Measurement Range