All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libertas: kill useless #define LBS_MONITOR_OFF 0
@ 2008-03-26  8:57 Holger Schurig
  2008-03-26 14:16 ` Dan Williams
  0 siblings, 1 reply; 2+ messages in thread
From: Holger Schurig @ 2008-03-26  8:57 UTC (permalink / raw)
  To: libertas-dev; +Cc: Dan Williams, linux-wireless, John W. Linville

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>

--- wireless-testing.orig/drivers/net/wireless/libertas/wext.h
+++ wireless-testing/drivers/net/wireless/libertas/wext.h
@@ -15,8 +15,6 @@
 	u32 value;
 };
 
-#define LBS_MONITOR_OFF			0
-
 extern struct iw_handler_def lbs_handler_def;
 extern struct iw_handler_def mesh_handler_def;
 
--- wireless-testing.orig/drivers/net/wireless/libertas/main.c
+++ wireless-testing/drivers/net/wireless/libertas/main.c
@@ -277,10 +277,10 @@
 	struct lbs_private *priv = to_net_dev(dev)->priv;
 
 	sscanf(buf, "%x", &monitor_mode);
-	if (monitor_mode != LBS_MONITOR_OFF) {
-		if(priv->monitormode == monitor_mode)
+	if (monitor_mode) {
+		if (priv->monitormode == monitor_mode)
 			return strlen(buf);
-		if (priv->monitormode == LBS_MONITOR_OFF) {
+		if (!priv->monitormode) {
 			if (priv->infra_open || priv->mesh_open)
 				return -EBUSY;
 			if (priv->mode == IW_MODE_INFRA)
@@ -293,9 +293,9 @@
 	}
 
 	else {
-		if (priv->monitormode == LBS_MONITOR_OFF)
+		if (!priv->monitormode)
 			return strlen(buf);
-		priv->monitormode = LBS_MONITOR_OFF;
+		priv->monitormode = 0;
 		lbs_remove_rtap(priv);
 
 		if (priv->currenttxskb) {
@@ -392,7 +392,7 @@
 
 	spin_lock_irq(&priv->driver_lock);
 
-	if (priv->monitormode != LBS_MONITOR_OFF) {
+	if (priv->monitormode) {
 		ret = -EBUSY;
 		goto out;
 	}
--- wireless-testing.orig/drivers/net/wireless/libertas/rx.c
+++ wireless-testing/drivers/net/wireless/libertas/rx.c
@@ -155,7 +155,7 @@
 
 	skb->ip_summed = CHECKSUM_NONE;
 
-	if (priv->monitormode != LBS_MONITOR_OFF)
+	if (priv->monitormode)
 		return process_rxed_802_11_packet(priv, skb);
 
 	p_rx_pkt = (struct rxpackethdr *) skb->data;
--- wireless-testing.orig/drivers/net/wireless/libertas/tx.c
+++ wireless-testing/drivers/net/wireless/libertas/tx.c
@@ -151,7 +151,7 @@
 
 	dev->trans_start = jiffies;
 
-	if (priv->monitormode != LBS_MONITOR_OFF) {
+	if (priv->monitormode) {
 		/* Keep the skb to echo it back once Tx feedback is
 		   received from FW */
 		skb_orphan(skb);
@@ -186,8 +186,7 @@
 	int txfail;
 	int try_count;
 
-	if (priv->monitormode == LBS_MONITOR_OFF ||
-	    priv->currenttxskb == NULL)
+	if (!priv->monitormode || priv->currenttxskb == NULL)
 		return;
 
 	radiotap_hdr = (struct tx_radiotap_hdr *)priv->currenttxskb->data;

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

* Re: [PATCH] libertas: kill useless #define LBS_MONITOR_OFF 0
  2008-03-26  8:57 [PATCH] libertas: kill useless #define LBS_MONITOR_OFF 0 Holger Schurig
@ 2008-03-26 14:16 ` Dan Williams
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Williams @ 2008-03-26 14:16 UTC (permalink / raw)
  To: Holger Schurig; +Cc: libertas-dev, linux-wireless, John W. Linville

On Wed, 2008-03-26 at 09:57 +0100, Holger Schurig wrote:
> Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>

Acked-by: Dan Williams <dcbw@redhat.com>

> --- wireless-testing.orig/drivers/net/wireless/libertas/wext.h
> +++ wireless-testing/drivers/net/wireless/libertas/wext.h
> @@ -15,8 +15,6 @@
>  	u32 value;
>  };
>  
> -#define LBS_MONITOR_OFF			0
> -
>  extern struct iw_handler_def lbs_handler_def;
>  extern struct iw_handler_def mesh_handler_def;
>  
> --- wireless-testing.orig/drivers/net/wireless/libertas/main.c
> +++ wireless-testing/drivers/net/wireless/libertas/main.c
> @@ -277,10 +277,10 @@
>  	struct lbs_private *priv = to_net_dev(dev)->priv;
>  
>  	sscanf(buf, "%x", &monitor_mode);
> -	if (monitor_mode != LBS_MONITOR_OFF) {
> -		if(priv->monitormode == monitor_mode)
> +	if (monitor_mode) {
> +		if (priv->monitormode == monitor_mode)
>  			return strlen(buf);
> -		if (priv->monitormode == LBS_MONITOR_OFF) {
> +		if (!priv->monitormode) {
>  			if (priv->infra_open || priv->mesh_open)
>  				return -EBUSY;
>  			if (priv->mode == IW_MODE_INFRA)
> @@ -293,9 +293,9 @@
>  	}
>  
>  	else {
> -		if (priv->monitormode == LBS_MONITOR_OFF)
> +		if (!priv->monitormode)
>  			return strlen(buf);
> -		priv->monitormode = LBS_MONITOR_OFF;
> +		priv->monitormode = 0;
>  		lbs_remove_rtap(priv);
>  
>  		if (priv->currenttxskb) {
> @@ -392,7 +392,7 @@
>  
>  	spin_lock_irq(&priv->driver_lock);
>  
> -	if (priv->monitormode != LBS_MONITOR_OFF) {
> +	if (priv->monitormode) {
>  		ret = -EBUSY;
>  		goto out;
>  	}
> --- wireless-testing.orig/drivers/net/wireless/libertas/rx.c
> +++ wireless-testing/drivers/net/wireless/libertas/rx.c
> @@ -155,7 +155,7 @@
>  
>  	skb->ip_summed = CHECKSUM_NONE;
>  
> -	if (priv->monitormode != LBS_MONITOR_OFF)
> +	if (priv->monitormode)
>  		return process_rxed_802_11_packet(priv, skb);
>  
>  	p_rx_pkt = (struct rxpackethdr *) skb->data;
> --- wireless-testing.orig/drivers/net/wireless/libertas/tx.c
> +++ wireless-testing/drivers/net/wireless/libertas/tx.c
> @@ -151,7 +151,7 @@
>  
>  	dev->trans_start = jiffies;
>  
> -	if (priv->monitormode != LBS_MONITOR_OFF) {
> +	if (priv->monitormode) {
>  		/* Keep the skb to echo it back once Tx feedback is
>  		   received from FW */
>  		skb_orphan(skb);
> @@ -186,8 +186,7 @@
>  	int txfail;
>  	int try_count;
>  
> -	if (priv->monitormode == LBS_MONITOR_OFF ||
> -	    priv->currenttxskb == NULL)
> +	if (!priv->monitormode || priv->currenttxskb == NULL)
>  		return;
>  
>  	radiotap_hdr = (struct tx_radiotap_hdr *)priv->currenttxskb->data;


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

end of thread, other threads:[~2008-03-26 14:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-26  8:57 [PATCH] libertas: kill useless #define LBS_MONITOR_OFF 0 Holger Schurig
2008-03-26 14:16 ` Dan Williams

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.