drivers/net/wireless/intel/iwlwifi/mld/power.c

Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/mld/power.c

File Facts

System
Linux kernel
Corpus path
drivers/net/wireless/intel/iwlwifi/mld/power.c
Extension
.c
Size
15103 bytes
Lines
540
Domain
Driver Families
Bucket
drivers/net
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

if (!tid_found && !link->queue_params[ac].acm) {
			tid_found = true;
			switch (ac) {
			case IEEE80211_AC_VO:
				cmd->qndp_tid = 6;
				break;
			case IEEE80211_AC_VI:
				cmd->qndp_tid = 5;
				break;
			case IEEE80211_AC_BE:
				cmd->qndp_tid = 0;
				break;
			case IEEE80211_AC_BK:
				cmd->qndp_tid = 1;
				break;
			}
		}
	}

	if (cmd->uapsd_ac_flags == (BIT(IEEE80211_AC_VO) |
				    BIT(IEEE80211_AC_VI) |
				    BIT(IEEE80211_AC_BE) |
				    BIT(IEEE80211_AC_BK))) {
		cmd->flags |= cpu_to_le16(POWER_FLAGS_SNOOZE_ENA_MSK);
		cmd->snooze_interval = cpu_to_le16(IWL_MLD_PS_SNOOZE_INTERVAL);
		cmd->snooze_window = cpu_to_le16(IWL_MLD_PS_SNOOZE_WINDOW);
	}

	cmd->uapsd_max_sp = mld->hw->uapsd_max_sp_len;
}

static void iwl_mld_power_configure_uapsd(struct iwl_mld *mld,
					  struct iwl_mld_link *link,
					  struct iwl_mac_power_cmd *cmd,
					  bool ps_poll)
{
	bool tid_found = false;

	/* set advanced pm flag with no uapsd ACs to enable ps-poll */
	if (ps_poll) {
		cmd->flags |= cpu_to_le16(POWER_FLAGS_ADVANCE_PM_ENA_MSK);
		return;
	}

	for (enum ieee80211_ac_numbers ac = IEEE80211_AC_VO;
	     ac <= IEEE80211_AC_BK;
	     ac++) {
		if (!link->queue_params[ac].uapsd)
			continue;

		cmd->flags |=
			cpu_to_le16(POWER_FLAGS_ADVANCE_PM_ENA_MSK);
		cmd->uapsd_ac_flags |= BIT(ac);

		/* QNDP TID - the highest TID with no admission control */
		if (!tid_found && !link->queue_params[ac].acm) {
			tid_found = true;
			switch (ac) {
			case IEEE80211_AC_VO:
				cmd->qndp_tid = 6;
				break;
			case IEEE80211_AC_VI:
				cmd->qndp_tid = 5;
				break;
			case IEEE80211_AC_BE:
				cmd->qndp_tid = 0;
				break;
			case IEEE80211_AC_BK:
				cmd->qndp_tid = 1;
				break;
			}
		}
	}
}

static void
iwl_mld_power_config_skip_dtim(struct iwl_mld *mld,
			       const struct ieee80211_bss_conf *link_conf,
			       u8 *skip_dtim_periods, __le16 *flags)
{
	unsigned int dtimper_tu;
	unsigned int dtimper;
	unsigned int skip;

	dtimper = link_conf->dtim_period ?: 1;
	dtimper_tu = dtimper * link_conf->beacon_int;

	if (dtimper >= 10 || iwl_mld_power_is_radar(mld, link_conf))
		return;

Annotation

Implementation Notes