An AP configured with hostapd's time_advertisement=2 includes the IEEE 802.11v Time Advertisement and Time Zone elements in its beacons, but iw shows them only as unknown IEs, and only with -u. The Time Zone element is just a POSIX TZ string, so print it verbatim. For Time Advertisement, print the timing capabilities field and, for method 2, the UTC time at which the TSF timer was zero: Time Advertisement: * timing capabilities: 2 * UTC time at TSF 0: 2026-10-19 20:50:45.000 Time Zone: GMT0BST,M3.5.0/1,M10.5.0 Signed-off-by: David Woodhouse --- ieee80211.h | 2 ++ scan.c | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/ieee80211.h b/ieee80211.h index 2e6b68b..a53fb61 100644 --- a/ieee80211.h +++ b/ieee80211.h @@ -78,8 +78,10 @@ enum elem_id { EID_HT_OPERATION = 61, EID_SECONDARY_CH_OFFSET = 62, EID_MEASUREMENT_PILOT_TX = 66, + EID_TIME_ADVERTISEMENT = 69, EID_RM_ENABLED_CAPABILITIES = 70, EID_OVERLAP_BSS_SCAN_PARAM = 74, + EID_TIME_ZONE = 98, EID_INTERWORKING = 107, EID_ADVERTISEMENT = 108, EID_ROAMING_CONSORTIUM = 111, diff --git a/scan.c b/scan.c index 2b6e904..871f72f 100644 --- a/scan.c +++ b/scan.c @@ -1822,6 +1822,22 @@ static void print_ie(const struct ie_print *p, const uint8_t type, uint8_t len, p->print(type, len, data, ctx); } +static void print_time_adv(const uint8_t type, uint8_t len, const uint8_t *data, + const struct ie_context *ctx) +{ + printf("\n"); + printf("\t\t * timing capabilities: %d\n", data[0]); + + /* Time Value, Time Error and Time Update fields are only + * present for timing capabilities value 2 (UTC at TSF 0) */ + if (data[0] != 2 || len < 17) + return; + + printf("\t\t * UTC time at TSF 0: %04d-%02d-%02d %02d:%02d:%02d.%03d\n", + (data[2] << 8) | data[1], data[3], data[4], + data[5], data[6], data[7], (data[9] << 8) | data[8]); +} + #define PRINT_IGN { \ .name = "IGNORE", \ .print = NULL, \ @@ -1850,6 +1866,9 @@ static const struct ie_print ieprinters[] = { print_supp_op_classes, 1, 255, BIT(PRINT_SCAN), }, [EID_MEASUREMENT_PILOT_TX] = { "Measurement Pilot Transmission", print_measurement_pilot_tx, 1, 255, BIT(PRINT_SCAN), }, + [EID_TIME_ADVERTISEMENT] = { "Time Advertisement", print_time_adv, + 1, 255, BIT(PRINT_SCAN), }, + [EID_TIME_ZONE] = { "Time Zone", print_ssid, 1, 255, BIT(PRINT_SCAN), }, [EID_OVERLAP_BSS_SCAN_PARAM] = { "Overlapping BSS scan params", print_obss_scan_params, 14, 255, BIT(PRINT_SCAN), }, [EID_HT_OPERATION] = { "HT operation", print_ht_op, 22, 22, BIT(PRINT_SCAN), }, -- 2.43.0