Search Linux Wireless

Re: [PATCH 2.6.30] iwl3945: fix rfkill switch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 11, 2009 at 04:09:08PM +0200, Stanislaw Gruszka wrote:
> diff --git a/drivers/net/wireless/iwlwifi/iwl-rfkill.c b/drivers/net/wireless/iwlwifi/iwl-rfkill.c
> index d6b6098..636c04a 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-rfkill.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-rfkill.c
> @@ -35,6 +35,19 @@
>  #include "iwl-dev.h"
>  #include "iwl-core.h"
>  
> +static void iwl_force_rfkill_state(struct iwl_priv *priv,
> +				   enum rfkill_state state)
> +{
> +	enum rfkill_state oldstate;
> +
> +	oldstate = priv->rfkill->state;
> +	priv->rfkill->state = state;
> +
> +	/* rfkill_uevent() */
> +	if (oldstate != state)
> +		kobject_uevent(&priv->rfkill->dev.kobj, KOBJ_CHANGE);

This is not needed because rfkill_toggle_radio() will send
rfkill_uevent().
  
> +}
> +
>  /* software rf-kill from user */
>  static int iwl_rfkill_soft_rf_kill(void *data, enum rfkill_state state)
>  {
> @@ -54,8 +67,9 @@ static int iwl_rfkill_soft_rf_kill(void *data, enum rfkill_state state)
>  	case RFKILL_STATE_UNBLOCKED:
>  		if (iwl_is_rfkill_hw(priv)) {
>  			err = -EBUSY;
> -			/* pass error to rfkill core to make it state HARD
> +			/* pass error to rfkill core, make it state HARD
>  			 * BLOCKED and disable software kill switch */
> +			iwl_force_rfkill_state(priv, RFKILL_STATE_HARD_BLOCKED);
>  		}
>  		iwl_radio_kill_sw_enable_radio(priv);
>  		break;
> @@ -63,10 +77,10 @@ static int iwl_rfkill_soft_rf_kill(void *data, enum rfkill_state state)
>  		iwl_radio_kill_sw_disable_radio(priv);
>  		/* rfkill->mutex lock is taken */
>  		if (priv->rfkill->state == RFKILL_STATE_HARD_BLOCKED) {
> -			/* force rfkill core state to be SOFT BLOCKED,
> +			/* force rfkill core state to be in SOFT BLOCKED,
>  			 * otherwise core will be unable to disable software
>  			 * kill switch */
> -			priv->rfkill->state = RFKILL_STATE_SOFT_BLOCKED;
> +			iwl_force_rfkill_state(priv, RFKILL_STATE_SOFT_BLOCKED);
>  		}
>  		break;

Stanislaw
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux