diff --git a/sys/dev/iwm/if_iwm.c b/sys/dev/iwm/if_iwm.c index 6299f0fe2fdc..e5a98c0ca2a8 100644 --- a/sys/dev/iwm/if_iwm.c +++ b/sys/dev/iwm/if_iwm.c @@ -5451,8 +5451,20 @@ iwm_notif_intr(struct iwm_softc *sc) notif->source_id, sc->sc_fw_mcc); break; } - case IWM_DTS_MEASUREMENT_NOTIFICATION: + case IWM_DTS_MEASUREMENT_NOTIFICATION: { + struct iwm_dts_measurement_notif_v1 *notif; + + if (iwm_rx_packet_payload_len(pkt) < sizeof(*notif)) { + device_printf(sc->sc_dev, + "Invalid DTS_MEASUREMENT_NOTIFICATION\n"); + break; + } + notif = (void *)pkt->data; + IWM_DPRINTF(sc, IWM_DEBUG_TEMP, + "IWM_DTS_MEASUREMENT_NOTIFICATION - %d\n", + notif->temp); break; + } case IWM_PHY_CONFIGURATION_CMD: case IWM_TX_ANT_CONFIGURATION_CMD: diff --git a/sys/dev/iwm/if_iwm_debug.h b/sys/dev/iwm/if_iwm_debug.h index a741945b5f8c..6b09bddb9f62 100644 --- a/sys/dev/iwm/if_iwm_debug.h +++ b/sys/dev/iwm/if_iwm_debug.h @@ -41,6 +41,7 @@ enum { IWM_DEBUG_FIRMWARE_TLV = 0x00020000, /* Firmware TLV parsing */ IWM_DEBUG_TRANS = 0x00040000, /* Transport layer (eg PCIe) */ IWM_DEBUG_EEPROM = 0x00080000, /* EEPROM/channel information */ + IWM_DEBUG_TEMP = 0x00100000, /* Thermal Sensor handling */ IWM_DEBUG_REGISTER = 0x20000000, /* print chipset register */ IWM_DEBUG_TRACE = 0x40000000, /* Print begin and start driver function */ IWM_DEBUG_FATAL = 0x80000000, /* fatal errors */ diff --git a/sys/dev/iwm/if_iwmreg.h b/sys/dev/iwm/if_iwmreg.h index 09ff173e857a..f84e491097bb 100644 --- a/sys/dev/iwm/if_iwmreg.h +++ b/sys/dev/iwm/if_iwmreg.h @@ -5978,6 +5978,30 @@ enum iwm_mcc_source { IWM_MCC_SOURCE_GETTING_MCC_TEST_MODE = 0x11, }; +/** + * struct iwm_dts_measurement_notif_v1 - measurements notification + * + * @temp: the measured temperature + * @voltage: the measured voltage + */ +struct iwm_dts_measurement_notif_v1 { + int32_t temp; + int32_t voltage; +} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_1*/ + +/** + * struct iwm_dts_measurement_notif_v2 - measurements notification + * + * @temp: the measured temperature + * @voltage: the measured voltage + * @threshold_idx: the trip index that was crossed + */ +struct iwm_dts_measurement_notif_v2 { + int32_t temp; + int32_t voltage; + int32_t threshold_idx; +} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_2 */ + /* * Some cherry-picked definitions */