linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] wl1271: avoid redundant memcpy of rx_status
@ 2010-09-19 16:55 Eliad Peller
  2010-09-19 16:55 ` [PATCH 2/2] wl1271: bugfix: use bitwise-AND instead of logical-AND Eliad Peller
  2010-09-19 19:46 ` [PATCH 1/2] wl1271: avoid redundant memcpy of rx_status Luciano Coelho
  0 siblings, 2 replies; 4+ messages in thread
From: Eliad Peller @ 2010-09-19 16:55 UTC (permalink / raw)
  To: linux-wireless; +Cc: Luciano Coelho

copy the rx_status directly to skb->cb (control buffer) instead of copying
it to a local struct and then copying it again (for each rx packet)

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 drivers/net/wireless/wl12xx/wl1271_rx.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/wl1271_rx.c b/drivers/net/wireless/wl12xx/wl1271_rx.c
index 019aa79..94da5dd 100644
--- a/drivers/net/wireless/wl12xx/wl1271_rx.c
+++ b/drivers/net/wireless/wl12xx/wl1271_rx.c
@@ -76,7 +76,6 @@ static void wl1271_rx_status(struct wl1271 *wl,
 
 static void wl1271_rx_handle_data(struct wl1271 *wl, u32 length)
 {
-	struct ieee80211_rx_status rx_status;
 	struct wl1271_rx_descriptor *desc;
 	struct sk_buff *skb;
 	u16 *fc;
@@ -109,14 +108,13 @@ static void wl1271_rx_handle_data(struct wl1271 *wl, u32 length)
 	if ((*fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_BEACON)
 		beacon = 1;
 
-	wl1271_rx_status(wl, desc, &rx_status, beacon);
+	wl1271_rx_status(wl, desc, IEEE80211_SKB_RXCB(skb), beacon);
 
 	wl1271_debug(DEBUG_RX, "rx skb 0x%p: %d B %s", skb, skb->len,
 		     beacon ? "beacon" : "");
 
 	skb_trim(skb, skb->len - desc->pad_len);
 
-	memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, sizeof(rx_status));
 	ieee80211_rx_ni(wl->hw, skb);
 }
 
-- 
1.7.0.4


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

* [PATCH 2/2] wl1271: bugfix: use bitwise-AND instead of logical-AND
  2010-09-19 16:55 [PATCH 1/2] wl1271: avoid redundant memcpy of rx_status Eliad Peller
@ 2010-09-19 16:55 ` Eliad Peller
  2010-09-19 19:47   ` Luciano Coelho
  2010-09-19 19:46 ` [PATCH 1/2] wl1271: avoid redundant memcpy of rx_status Luciano Coelho
  1 sibling, 1 reply; 4+ messages in thread
From: Eliad Peller @ 2010-09-19 16:55 UTC (permalink / raw)
  To: linux-wireless; +Cc: Luciano Coelho

typo - while looking for specific bits we should do a bitwise-AND instead of logical-AND.

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 drivers/net/wireless/wl12xx/wl1271_main.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index e6e0852..d2b8486 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -1635,7 +1635,7 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
 	if (ret < 0)
 		goto out;
 
-	if ((changed && BSS_CHANGED_BEACON_INT) &&
+	if ((changed & BSS_CHANGED_BEACON_INT) &&
 	    (wl->bss_type == BSS_TYPE_IBSS)) {
 		wl1271_debug(DEBUG_ADHOC, "ad-hoc beacon interval updated: %d",
 			bss_conf->beacon_int);
@@ -1644,7 +1644,7 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
 		do_join = true;
 	}
 
-	if ((changed && BSS_CHANGED_BEACON) &&
+	if ((changed & BSS_CHANGED_BEACON) &&
 	    (wl->bss_type == BSS_TYPE_IBSS)) {
 		struct sk_buff *beacon = ieee80211_beacon_get(hw, vif);
 
-- 
1.7.0.4


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

* Re: [PATCH 1/2] wl1271: avoid redundant memcpy of rx_status
  2010-09-19 16:55 [PATCH 1/2] wl1271: avoid redundant memcpy of rx_status Eliad Peller
  2010-09-19 16:55 ` [PATCH 2/2] wl1271: bugfix: use bitwise-AND instead of logical-AND Eliad Peller
@ 2010-09-19 19:46 ` Luciano Coelho
  1 sibling, 0 replies; 4+ messages in thread
From: Luciano Coelho @ 2010-09-19 19:46 UTC (permalink / raw)
  To: ext Eliad Peller; +Cc: linux-wireless@vger.kernel.org

On Sun, 2010-09-19 at 18:55 +0200, ext Eliad Peller wrote:
> copy the rx_status directly to skb->cb (control buffer) instead of copying
> it to a local struct and then copying it again (for each rx packet)
> 
> Signed-off-by: Eliad Peller <eliad@wizery.com>
> ---

Acked-by: Luciano Coelho <luciano.coelho@nokia.com>

Thanks, Eliad!


-- 
Cheers,
Luca.


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

* Re: [PATCH 2/2] wl1271: bugfix: use bitwise-AND instead of logical-AND
  2010-09-19 16:55 ` [PATCH 2/2] wl1271: bugfix: use bitwise-AND instead of logical-AND Eliad Peller
@ 2010-09-19 19:47   ` Luciano Coelho
  0 siblings, 0 replies; 4+ messages in thread
From: Luciano Coelho @ 2010-09-19 19:47 UTC (permalink / raw)
  To: ext Eliad Peller; +Cc: linux-wireless@vger.kernel.org

On Sun, 2010-09-19 at 18:55 +0200, ext Eliad Peller wrote:
> typo - while looking for specific bits we should do a bitwise-AND instead of logical-AND.
> 
> Signed-off-by: Eliad Peller <eliad@wizery.com>
> ---
>  drivers/net/wireless/wl12xx/wl1271_main.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
> index e6e0852..d2b8486 100644
> --- a/drivers/net/wireless/wl12xx/wl1271_main.c
> +++ b/drivers/net/wireless/wl12xx/wl1271_main.c
> @@ -1635,7 +1635,7 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
>  	if (ret < 0)
>  		goto out;
>  
> -	if ((changed && BSS_CHANGED_BEACON_INT) &&
> +	if ((changed & BSS_CHANGED_BEACON_INT) &&
>  	    (wl->bss_type == BSS_TYPE_IBSS)) {
>  		wl1271_debug(DEBUG_ADHOC, "ad-hoc beacon interval updated: %d",
>  			bss_conf->beacon_int);
> @@ -1644,7 +1644,7 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
>  		do_join = true;
>  	}
>  
> -	if ((changed && BSS_CHANGED_BEACON) &&
> +	if ((changed & BSS_CHANGED_BEACON) &&
>  	    (wl->bss_type == BSS_TYPE_IBSS)) {
>  		struct sk_buff *beacon = ieee80211_beacon_get(hw, vif);
 
Acked-by: Luciano Coelho <luciano.coelho@nokia.com>

Nice catch! Thanks for your patch.

-- 
Cheers,
Luca.


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

end of thread, other threads:[~2010-09-19 19:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-19 16:55 [PATCH 1/2] wl1271: avoid redundant memcpy of rx_status Eliad Peller
2010-09-19 16:55 ` [PATCH 2/2] wl1271: bugfix: use bitwise-AND instead of logical-AND Eliad Peller
2010-09-19 19:47   ` Luciano Coelho
2010-09-19 19:46 ` [PATCH 1/2] wl1271: avoid redundant memcpy of rx_status Luciano Coelho

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).