Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5ed540ae authored by Wey-Yi Guy's avatar Wey-Yi Guy
Browse files

iwlwifi: use mac80211 throughput trigger



Instead of keeping track of LED blink speed
in the driver, use the new mac80211 trigger
and link it up with an LED classdev that we
now register. This also allows users more
flexibility in how they want to have the LED
blink or not.

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
parent 4a4fdf2e
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2,6 +2,10 @@ config IWLWIFI
	tristate "Intel Wireless Wifi"
	depends on PCI && MAC80211
	select FW_LOADER
	select NEW_LEDS
	select LEDS_CLASS
	select LEDS_TRIGGERS
	select MAC80211_LEDS

menu "Debugging Options"
	depends on IWLWIFI
+0 −27
Original line number Diff line number Diff line
@@ -59,33 +59,6 @@ static int iwl3945_send_led_cmd(struct iwl_priv *priv,
	return iwl_send_cmd(priv, &cmd);
}

/* Set led on command */
static int iwl3945_led_on(struct iwl_priv *priv)
{
	struct iwl_led_cmd led_cmd = {
		.id = IWL_LED_LINK,
		.on = IWL_LED_SOLID,
		.off = 0,
		.interval = IWL_DEF_LED_INTRVL
	};
	return iwl3945_send_led_cmd(priv, &led_cmd);
}

/* Set led off command */
static int iwl3945_led_off(struct iwl_priv *priv)
{
	struct iwl_led_cmd led_cmd = {
		.id = IWL_LED_LINK,
		.on = 0,
		.off = 0,
		.interval = IWL_DEF_LED_INTRVL
	};
	IWL_DEBUG_LED(priv, "led off\n");
	return iwl3945_send_led_cmd(priv, &led_cmd);
}

const struct iwl_led_ops iwl3945_led_ops = {
	.cmd = iwl3945_send_led_cmd,
	.on = iwl3945_led_on,
	.off = iwl3945_led_off,
};
+1 −13
Original line number Diff line number Diff line
@@ -63,23 +63,11 @@ static int iwl_send_led_cmd(struct iwl_priv *priv, struct iwl_led_cmd *led_cmd)
}

/* Set led register off */
static int iwl_led_on_reg(struct iwl_priv *priv)
void iwlagn_led_enable(struct iwl_priv *priv)
{
	IWL_DEBUG_LED(priv, "led on\n");
	iwl_write32(priv, CSR_LED_REG, CSR_LED_REG_TRUN_ON);
	return 0;
}

/* Set led register off */
static int iwl_led_off_reg(struct iwl_priv *priv)
{
	IWL_DEBUG_LED(priv, "LED Reg off\n");
	iwl_write32(priv, CSR_LED_REG, CSR_LED_REG_TRUN_OFF);
	return 0;
}

const struct iwl_led_ops iwlagn_led_ops = {
	.cmd = iwl_send_led_cmd,
	.on = iwl_led_on_reg,
	.off = iwl_led_off_reg,
};
+1 −0
Original line number Diff line number Diff line
@@ -28,5 +28,6 @@
#define __iwl_agn_led_h__

extern const struct iwl_led_ops iwlagn_led_ops;
void iwlagn_led_enable(struct iwl_priv *priv);

#endif /* __iwl_agn_led_h__ */
+0 −2
Original line number Diff line number Diff line
@@ -557,12 +557,10 @@ void iwlagn_bss_info_changed(struct ieee80211_hw *hw,

	if (changes & BSS_CHANGED_ASSOC) {
		if (bss_conf->assoc) {
			iwl_led_associate(priv);
			priv->timestamp = bss_conf->timestamp;
			ctx->staging.filter_flags |= RXON_FILTER_ASSOC_MSK;
		} else {
			ctx->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
			iwl_led_disassociate(priv);
		}
	}

Loading