Ejemplo n.º 1
0
int iwl_power_update_mode(struct iwl_priv *priv, bool force)
{
	struct iwl_powertable_cmd cmd;

	iwl_power_build_cmd(priv, &cmd);
	return iwl_power_set_mode(priv, &cmd, force);
}
Ejemplo n.º 2
0
Archivo: power.c Proyecto: mbgg/linux
int iwl_mvm_power_update_mode(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
{
	struct iwl_powertable_cmd cmd = {};

	if (!iwlwifi_mod_params.power_save) {
		IWL_DEBUG_POWER(mvm, "Power management is not allowed\n");
		return 0;
	}

	if (vif->type != NL80211_IFTYPE_STATION || vif->p2p)
		return 0;

	iwl_power_build_cmd(mvm, vif, &cmd);

	IWL_DEBUG_POWER(mvm,
			"Sending power table command on mac id 0x%X for power level %d, flags = 0x%X\n",
			cmd.id_and_color, iwlmvm_mod_params.power_scheme,
			le16_to_cpu(cmd.flags));

	if (cmd.flags & cpu_to_le16(POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK)) {
		IWL_DEBUG_POWER(mvm, "Keep alive = %u sec\n",
				le16_to_cpu(cmd.keep_alive_seconds));
		IWL_DEBUG_POWER(mvm, "Rx timeout = %u usec\n",
				le32_to_cpu(cmd.rx_data_timeout));
		IWL_DEBUG_POWER(mvm, "Tx timeout = %u usec\n",
				le32_to_cpu(cmd.tx_data_timeout));
		IWL_DEBUG_POWER(mvm, "Rx timeout (uAPSD) = %u usec\n",
				le32_to_cpu(cmd.rx_data_timeout_uapsd));
		IWL_DEBUG_POWER(mvm, "Tx timeout = %u usec\n",
				le32_to_cpu(cmd.tx_data_timeout_uapsd));
		IWL_DEBUG_POWER(mvm, "LP RX RSSI threshold = %u\n",
				cmd.lprx_rssi_threshold);
		IWL_DEBUG_POWER(mvm, "DTIMs to skip = %u\n", cmd.num_skip_dtim);
	}

	return iwl_mvm_send_cmd_pdu(mvm, POWER_TABLE_CMD, CMD_SYNC,
				    sizeof(cmd), &cmd);
}
Ejemplo n.º 3
0
Archivo: power.c Proyecto: mbgg/linux
void iwl_power_get_params(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
			  struct iwl_powertable_cmd *cmd)
{
	iwl_power_build_cmd(mvm, vif, cmd);
}