We have been running iwm(4) devices in "continous active mode (CAM)". Apparently this mode is meant for debugging only and wastes power.
This diff turns CAM off and enables device-level power saving. As far as I can tell, this means the firmware can turn off some parts of the chip when they are not needed. So it might save some battery life. There is no visible change in behaviour. This does *not* enable powersaving in the sense that we're telling the AP that we'll snooze and it will have to buffer frames for us etc. That behaviour is controlled by a separate "power management" flag and unfortunately when setting that flag iwm(4) does not work well with my athn(4) AP so I'll leave that feature disabled. Index: if_iwm.c =================================================================== RCS file: /cvs/src/sys/dev/pci/if_iwm.c,v retrieving revision 1.221 diff -u -p -r1.221 if_iwm.c --- if_iwm.c 8 Dec 2017 21:16:01 -0000 1.221 +++ if_iwm.c 10 Dec 2017 19:07:19 -0000 @@ -4498,11 +4498,7 @@ iwm_power_build_cmd(struct iwm_softc *sc keep_alive = roundup(keep_alive, 1000) / 1000; cmd->keep_alive_seconds = htole16(keep_alive); -#ifdef notyet cmd->flags = htole16(IWM_POWER_FLAGS_POWER_SAVE_ENA_MSK); - cmd->rx_data_timeout = IWM_DEFAULT_PS_RX_DATA_TIMEOUT; - cmd->tx_data_timeout = IWM_DEFAULT_PS_TX_DATA_TIMEOUT; -#endif } int @@ -4530,15 +4526,11 @@ int iwm_power_update_device(struct iwm_softc *sc) { struct iwm_device_power_cmd cmd = { -#ifdef notyet .flags = htole16(IWM_DEVICE_POWER_FLAGS_POWER_SAVE_ENA_MSK), -#endif }; if (!(sc->sc_capaflags & IWM_UCODE_TLV_FLAGS_DEVICE_PS_CMD)) return 0; - - cmd.flags |= htole16(IWM_DEVICE_POWER_FLAGS_CAM_MSK); return iwm_send_cmd_pdu(sc, IWM_POWER_TABLE_CMD, 0, sizeof(cmd), &cmd);