public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rfkill: Fix broken rfkill LED in 2.6.30-rc1
@ 2009-04-10  3:14 Larry Finger
  2009-04-10  7:33 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Larry Finger @ 2009-04-10  3:14 UTC (permalink / raw)
  To: John W Linville, Johannes Berg; +Cc: linux-wireless

The rfkill system fails to issue a LED trigger event when the rfkill state
changes.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---

John,

This is 2.6.31 material.

Larry
---

Index: wireless-testing/net/rfkill/rfkill.c
===================================================================
--- wireless-testing.orig/net/rfkill/rfkill.c
+++ wireless-testing/net/rfkill/rfkill.c
@@ -96,6 +96,7 @@ static void update_rfkill_state(struct r
 		}
 		mutex_unlock(&rfkill->mutex);
 	}
+	rfkill_led_trigger(rfkill, rfkill->state);
 }
 
 /**
@@ -136,8 +137,9 @@ static int rfkill_toggle_radio(struct rf
 	oldstate = rfkill->state;
 
 	if (rfkill->get_state && !force &&
-	    !rfkill->get_state(rfkill->data, &newstate))
+	    !rfkill->get_state(rfkill->data, &newstate)) {
 		rfkill->state = newstate;
+	}
 
 	switch (state) {
 	case RFKILL_STATE_HARD_BLOCKED:
@@ -172,6 +174,7 @@ static int rfkill_toggle_radio(struct rf
 	if (force || rfkill->state != oldstate)
 		rfkill_uevent(rfkill);
 
+	rfkill_led_trigger(rfkill, rfkill->state);
 	return retval;
 }
 
@@ -204,6 +207,7 @@ static void __rfkill_switch_all(const en
 			mutex_lock(&rfkill->mutex);
 			rfkill_toggle_radio(rfkill, state, 0);
 			mutex_unlock(&rfkill->mutex);
+			rfkill_led_trigger(rfkill, rfkill->state);
 		}
 	}
 }
@@ -256,6 +260,7 @@ void rfkill_epo(void)
 				RFKILL_STATE_SOFT_BLOCKED;
 	}
 	mutex_unlock(&rfkill_global_mutex);
+	rfkill_led_trigger(rfkill, rfkill->state);
 }
 EXPORT_SYMBOL_GPL(rfkill_epo);
 
@@ -358,6 +363,7 @@ int rfkill_force_state(struct rfkill *rf
 		rfkill_uevent(rfkill);
 
 	mutex_unlock(&rfkill->mutex);
+	rfkill_led_trigger(rfkill, rfkill->state);
 
 	return 0;
 }
@@ -520,6 +526,7 @@ static int rfkill_resume(struct device *
 				1);
 
 		mutex_unlock(&rfkill->mutex);
+		rfkill_led_trigger(rfkill, rfkill->state);
 	}
 
 	return 0;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] rfkill: Fix broken rfkill LED in 2.6.30-rc1
  2009-04-10  3:14 [PATCH] rfkill: Fix broken rfkill LED in 2.6.30-rc1 Larry Finger
@ 2009-04-10  7:33 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2009-04-10  7:33 UTC (permalink / raw)
  To: Larry Finger; +Cc: John W Linville, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 2279 bytes --]

On Thu, 2009-04-09 at 22:14 -0500, Larry Finger wrote:
> The rfkill system fails to issue a LED trigger event when the rfkill state
> changes.

I have no issues with this patch, and will just port my rewrite over it
-- I'll get back to the rewrite next week for good, hopefully.

johannes

> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> ---
> 
> John,
> 
> This is 2.6.31 material.
> 
> Larry
> ---
> 
> Index: wireless-testing/net/rfkill/rfkill.c
> ===================================================================
> --- wireless-testing.orig/net/rfkill/rfkill.c
> +++ wireless-testing/net/rfkill/rfkill.c
> @@ -96,6 +96,7 @@ static void update_rfkill_state(struct r
>  		}
>  		mutex_unlock(&rfkill->mutex);
>  	}
> +	rfkill_led_trigger(rfkill, rfkill->state);
>  }
>  
>  /**
> @@ -136,8 +137,9 @@ static int rfkill_toggle_radio(struct rf
>  	oldstate = rfkill->state;
>  
>  	if (rfkill->get_state && !force &&
> -	    !rfkill->get_state(rfkill->data, &newstate))
> +	    !rfkill->get_state(rfkill->data, &newstate)) {
>  		rfkill->state = newstate;
> +	}
>  
>  	switch (state) {
>  	case RFKILL_STATE_HARD_BLOCKED:
> @@ -172,6 +174,7 @@ static int rfkill_toggle_radio(struct rf
>  	if (force || rfkill->state != oldstate)
>  		rfkill_uevent(rfkill);
>  
> +	rfkill_led_trigger(rfkill, rfkill->state);
>  	return retval;
>  }
>  
> @@ -204,6 +207,7 @@ static void __rfkill_switch_all(const en
>  			mutex_lock(&rfkill->mutex);
>  			rfkill_toggle_radio(rfkill, state, 0);
>  			mutex_unlock(&rfkill->mutex);
> +			rfkill_led_trigger(rfkill, rfkill->state);
>  		}
>  	}
>  }
> @@ -256,6 +260,7 @@ void rfkill_epo(void)
>  				RFKILL_STATE_SOFT_BLOCKED;
>  	}
>  	mutex_unlock(&rfkill_global_mutex);
> +	rfkill_led_trigger(rfkill, rfkill->state);
>  }
>  EXPORT_SYMBOL_GPL(rfkill_epo);
>  
> @@ -358,6 +363,7 @@ int rfkill_force_state(struct rfkill *rf
>  		rfkill_uevent(rfkill);
>  
>  	mutex_unlock(&rfkill->mutex);
> +	rfkill_led_trigger(rfkill, rfkill->state);
>  
>  	return 0;
>  }
> @@ -520,6 +526,7 @@ static int rfkill_resume(struct device *
>  				1);
>  
>  		mutex_unlock(&rfkill->mutex);
> +		rfkill_led_trigger(rfkill, rfkill->state);
>  	}
>  
>  	return 0;
> 

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-04-10  7:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-10  3:14 [PATCH] rfkill: Fix broken rfkill LED in 2.6.30-rc1 Larry Finger
2009-04-10  7:33 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox