linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <sgruszka@redhat.com>
To: reinette chatre <reinette.chatre@intel.com>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"Zhu, Yi" <yi.zhu@intel.com>,
	"John W. Linville" <linville@tuxdriver.com>,
	"stable@kernel.org" <stable@kernel.org>
Subject: Re: [PATCH 2.6.30] iwl3945: fix rfkill switch
Date: Thu, 13 Aug 2009 09:31:22 +0200	[thread overview]
Message-ID: <20090813073122.GB2373@dhcp-lab-161.englab.brq.redhat.com> (raw)
In-Reply-To: <20090811140908.GA3235@dhcp-lab-161.englab.brq.redhat.com>

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

      parent reply	other threads:[~2009-08-13  7:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-04 12:35 [PATCH 2.6.30] iwl3945: fix rfkill switch Stanislaw Gruszka
2009-08-04 12:49 ` John W. Linville
2009-08-05 21:07   ` [stable] " Greg KH
2009-08-05 22:51 ` reinette chatre
2009-08-06  7:19   ` Stanislaw Gruszka
2009-08-06 20:15     ` reinette chatre
2009-08-07  6:31       ` Stanislaw Gruszka
2009-08-10 16:44         ` reinette chatre
2009-08-11 14:09           ` Stanislaw Gruszka
2009-08-11 18:08             ` reinette chatre
2009-08-12 15:12               ` Stanislaw Gruszka
2009-08-12 16:45                 ` reinette chatre
2009-08-13  7:28                   ` Stanislaw Gruszka
2009-08-13  7:31             ` Stanislaw Gruszka [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090813073122.GB2373@dhcp-lab-161.englab.brq.redhat.com \
    --to=sgruszka@redhat.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=reinette.chatre@intel.com \
    --cc=stable@kernel.org \
    --cc=yi.zhu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).