AP MODE - PS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’€ AP mode - PS πŸ’€

ok so this is a page from the Kernel API Manual (yes, AP mode - PS(9), we're being fancy today) and it's all about what happens when your station decides to take a little nap 😴✨


πŸŒ™ DESCRIPTION πŸŒ™

so picture this: a station is asleep. when that happens, the fw literally sets it as "asleep" πŸ’€ and every single frame sitting on shared queues β€” and by shared queues we mean non-aggregation queues, iykyk β€” headed to that station gets dropped by the fw, with the failure code TX_STATUS_FAIL_DEST_PS. not a vibe, but that's the rules 🫠

now AMPDUs are a whole different story β€” they live in a separate queue that is stopped by the fw. our only job here is to let mac80211 know when there are frames chillin' in these queues, so it can properly handle trigger frames. that's it, that's the task πŸ‘‘

and when a trigger frame shows up? mac80211 tells the driver to send frames from the AMPDU queues, or it just sends frames to the non-aggregation queues itself β€” depends on which ACs are delivery-enabled and which TID actually has frames to transmit πŸ”₯ note that mac80211 has all the knowledge, because all the non-agg frames are buffered / filtered, and the driver tells mac80211 about agg frames. the driver does need to tell the fw to let frames out even if the station is asleep β€” and that's done by iwl_mvm_sta_modify_sleep_tx_count πŸŽ€

then when we receive a frame from that station with the PM bit unset? the driver has to let the fw know that this station isn't asleep any more 😴➑️😳 that's iwl_mvm_sta_modify_ps_wake, done in response to mac80211 signaling the station's wakeup.

for a GO, the Service Period might get cut short due to an absence period of the GO β€” and in this case (and honestly all other cases) the firmware notifies us with the EOSP_NOTIFICATION, and we pass that along to mac80211. further frames that we already sent to the device will be rejected again. rude, but noted πŸ’…

also go read "AP support for powersaving clients" in mac80211.h β€” that's where the real lore lives 🧚

πŸ”— SEE ALSO πŸ”—

Kernel file ./drivers/net/wireless/intel/iwlwifi/mvm/sta.h β€” and bestie, the whole extended universe:

  • DQA - Dynamic Queue Allocation -introduction(9)
  • station table - introduction(9)
  • station table - locking(9)
  • station table - internal stations(9)
  • station table - AP Station in STA mode(9)
  • station table - Drain vs. Flush(9)
  • station table - fw restart(9)
  • enum iwl_mvm_agg_state(9)
  • struct iwl_mvm_tid_data(9)
  • enum iwl_mvm_rxq_notif_type(9)
  • struct iwl_mvm_internal_rxq_notif(9)
  • struct iwl_mvm_rxq_dup_data(9)
  • struct iwl_mvm_link_sta(9)
  • struct iwl_mvm_sta(9)
  • struct iwl_mvm_int_sta(9)
  • iwl_mvm_sta_send_to_fw(9)
  • struct iwl_mvm_sta_state_ops(9)

ok that's the whole page, go touch grass and then come back and read mac80211.h πŸŒˆπŸ¦‹ kisses! this one's from ./drivers/net/wireless/intel/i... and it's dated October 2026 β€” iconic, timeless, periodt πŸ’–πŸŽ€

πŸ“¦ where this page comes from