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

Commit c0af96a6 authored by Samuel Ortiz's avatar Samuel Ortiz Committed by John W. Linville
Browse files

iwl3945: Use iwl-rfkill



Here again, the rfkill routines are duplicated between agn and 3945. Let's
move the agn one to iwlcore, and so we can get rid of the 3945 ones.

Signed-off-by: default avatarSamuel Ortiz <samuel.ortiz@intel.com>
Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 7d049e5a
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@ config IWL3945
	select LIB80211
	select MAC80211_LEDS if IWL3945_LEDS
	select LEDS_CLASS if IWL3945_LEDS
	select RFKILL if IWL3945_RFKILL
	select RFKILL if IWLWIFI_RFKILL
	---help---
	  Select to build the driver supporting the:

@@ -133,10 +133,6 @@ config IWL3945
	  say M here and read <file:Documentation/kbuild/modules.txt>.  The
	  module will be called iwl3945.ko.

config IWL3945_RFKILL
	bool "Enable RF kill support in iwl3945 drivers"
	depends on IWL3945

config IWL3945_SPECTRUM_MEASUREMENT
	bool "Enable Spectrum Measurement in iwl3945 drivers"
	depends on IWL3945
+0 −12
Original line number Diff line number Diff line
@@ -304,18 +304,6 @@ extern int iwl3945_txpower_set_from_eeprom(struct iwl_priv *priv);
extern u8 iwl3945_sync_sta(struct iwl_priv *priv, int sta_id,
		 u16 tx_rate, u8 flags);

#ifdef CONFIG_IWL3945_RFKILL
struct iwl_priv;

void iwl3945_rfkill_set_hw_state(struct iwl_priv *priv);
void iwl3945_rfkill_unregister(struct iwl_priv *priv);
int iwl3945_rfkill_init(struct iwl_priv *priv);
#else
static inline void iwl3945_rfkill_set_hw_state(struct iwl_priv *priv) {}
static inline void iwl3945_rfkill_unregister(struct iwl_priv *priv) {}
static inline int iwl3945_rfkill_init(struct iwl_priv *priv) { return 0; }
#endif

static inline int iwl3945_is_associated(struct iwl_priv *priv)
{
	return (priv->active39_rxon.filter_flags & RXON_FILTER_ASSOC_MSK) ? 1 : 0;
+0 −35
Original line number Diff line number Diff line
@@ -2266,41 +2266,6 @@ static void iwl_bg_alive_start(struct work_struct *data)
	mutex_unlock(&priv->mutex);
}

static void iwl_bg_rf_kill(struct work_struct *work)
{
	struct iwl_priv *priv = container_of(work, struct iwl_priv, rf_kill);

	wake_up_interruptible(&priv->wait_command_queue);

	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
		return;

	mutex_lock(&priv->mutex);

	if (!iwl_is_rfkill(priv)) {
		IWL_DEBUG(IWL_DL_RF_KILL,
			  "HW and/or SW RF Kill no longer active, restarting "
			  "device\n");
		if (!test_bit(STATUS_EXIT_PENDING, &priv->status) &&
		     test_bit(STATUS_ALIVE, &priv->status))
			queue_work(priv->workqueue, &priv->restart);
	} else {
		/* make sure mac80211 stop sending Tx frame */
		if (priv->mac80211_registered)
			ieee80211_stop_queues(priv->hw);

		if (!test_bit(STATUS_RF_KILL_HW, &priv->status))
			IWL_DEBUG_RF_KILL("Can not turn radio back on - "
					  "disabled by SW switch\n");
		else
			IWL_WARN(priv, "Radio Frequency Kill Switch is On:\n"
				    "Kill switch must be turned off for "
				    "wireless networking to work.\n");
	}
	mutex_unlock(&priv->mutex);
	iwl_rfkill_set_hw_state(priv);
}

static void iwl_bg_run_time_calib_work(struct work_struct *work)
{
	struct iwl_priv *priv = container_of(work, struct iwl_priv,
+36 −0
Original line number Diff line number Diff line
@@ -1465,3 +1465,39 @@ int iwl_radio_kill_sw_enable_radio(struct iwl_priv *priv)
	return 1;
}
EXPORT_SYMBOL(iwl_radio_kill_sw_enable_radio);

void iwl_bg_rf_kill(struct work_struct *work)
{
	struct iwl_priv *priv = container_of(work, struct iwl_priv, rf_kill);

	wake_up_interruptible(&priv->wait_command_queue);

	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
		return;

	mutex_lock(&priv->mutex);

	if (!iwl_is_rfkill(priv)) {
		IWL_DEBUG(IWL_DL_RF_KILL,
			  "HW and/or SW RF Kill no longer active, restarting "
			  "device\n");
		if (!test_bit(STATUS_EXIT_PENDING, &priv->status) &&
		    test_bit(STATUS_ALIVE, &priv->status))
			queue_work(priv->workqueue, &priv->restart);
	} else {
		/* make sure mac80211 stop sending Tx frame */
		if (priv->mac80211_registered)
			ieee80211_stop_queues(priv->hw);

		if (!test_bit(STATUS_RF_KILL_HW, &priv->status))
			IWL_DEBUG_RF_KILL("Can not turn radio back on - "
					  "disabled by SW switch\n");
		else
			IWL_WARN(priv, "Radio Frequency Kill Switch is On:\n"
				    "Kill switch must be turned off for "
				    "wireless networking to work.\n");
	}
	mutex_unlock(&priv->mutex);
	iwl_rfkill_set_hw_state(priv);
}
EXPORT_SYMBOL(iwl_bg_rf_kill);
+1 −1
Original line number Diff line number Diff line
@@ -277,7 +277,7 @@ int iwl_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force);
 * RF -Kill - here and not in iwl-rfkill.h to be available when
 * RF-kill subsystem is not compiled.
 ****************************************************/
void iwl_rf_kill(struct iwl_priv *priv);
void iwl_bg_rf_kill(struct work_struct *work);
void iwl_radio_kill_sw_disable_radio(struct iwl_priv *priv);
int iwl_radio_kill_sw_enable_radio(struct iwl_priv *priv);

Loading