linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] b43: include FCS in frames handed to mac80211
@ 2007-11-23 10:46 Johannes Berg
  2007-11-23 13:51 ` Michael Buesch
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2007-11-23 10:46 UTC (permalink / raw)
  To: Michael Buesch; +Cc: linux-wireless

Sometimes it can be useful to see the FCS, especially when
bad-FCS frames are shown. Pass the FCS to mac80211 and let
it worry about snipping it off when required.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 drivers/net/wireless/b43/main.c |    3 ++-
 drivers/net/wireless/b43/xmit.c |    1 -
 2 files changed, 2 insertions(+), 2 deletions(-)

--- everything.orig/drivers/net/wireless/b43/main.c	2007-11-22 23:35:41.208716199 +0100
+++ everything/drivers/net/wireless/b43/main.c	2007-11-22 23:36:03.138677951 +0100
@@ -4158,7 +4158,8 @@ static int b43_wireless_init(struct ssb_
 	}
 
 	/* fill hw info */
-	hw->flags = IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE;
+	hw->flags = IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE |
+		    IEEE80211_HW_RX_INCLUDES_FCS;
 	hw->max_signal = 100;
 	hw->max_rssi = -110;
 	hw->max_noise = -110;
--- everything.orig/drivers/net/wireless/b43/xmit.c	2007-11-22 23:36:05.668676810 +0100
+++ everything/drivers/net/wireless/b43/xmit.c	2007-11-22 23:36:22.668677190 +0100
@@ -489,7 +489,6 @@ void b43_rx(struct b43_wldev *dev, struc
 	}
 	wlhdr = (struct ieee80211_hdr *)(skb->data);
 	fctl = le16_to_cpu(wlhdr->frame_control);
-	skb_trim(skb, skb->len - FCS_LEN);
 
 	if (macstat & B43_RX_MAC_DEC) {
 		unsigned int keyidx;



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

* Re: [PATCH] b43: include FCS in frames handed to mac80211
  2007-11-23 10:46 Johannes Berg
@ 2007-11-23 13:51 ` Michael Buesch
  2007-11-23 20:27   ` Johannes Berg
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Buesch @ 2007-11-23 13:51 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

On Friday 23 November 2007 11:46:16 Johannes Berg wrote:
> Sometimes it can be useful to see the FCS, especially when
> bad-FCS frames are shown. Pass the FCS to mac80211 and let
> it worry about snipping it off when required.
> 
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
> ---
>  drivers/net/wireless/b43/main.c |    3 ++-
>  drivers/net/wireless/b43/xmit.c |    1 -
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> --- everything.orig/drivers/net/wireless/b43/main.c	2007-11-22 23:35:41.208716199 +0100
> +++ everything/drivers/net/wireless/b43/main.c	2007-11-22 23:36:03.138677951 +0100
> @@ -4158,7 +4158,8 @@ static int b43_wireless_init(struct ssb_
>  	}
>  
>  	/* fill hw info */
> -	hw->flags = IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE;
> +	hw->flags = IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE |
> +		    IEEE80211_HW_RX_INCLUDES_FCS;
>  	hw->max_signal = 100;
>  	hw->max_rssi = -110;
>  	hw->max_noise = -110;
> --- everything.orig/drivers/net/wireless/b43/xmit.c	2007-11-22 23:36:05.668676810 +0100
> +++ everything/drivers/net/wireless/b43/xmit.c	2007-11-22 23:36:22.668677190 +0100
> @@ -489,7 +489,6 @@ void b43_rx(struct b43_wldev *dev, struc
>  	}
>  	wlhdr = (struct ieee80211_hdr *)(skb->data);
>  	fctl = le16_to_cpu(wlhdr->frame_control);
> -	skb_trim(skb, skb->len - FCS_LEN);
>  
>  	if (macstat & B43_RX_MAC_DEC) {
>  		unsigned int keyidx;
> 
> 
> 
> 

Does this work with all encryption and non-encryption modes?
There was a crypto related reason why we snipped off the FCS.
Maybe that's gone, though.

-- 
Greetings Michael.

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

* Re: [PATCH] b43: include FCS in frames handed to mac80211
  2007-11-23 13:51 ` Michael Buesch
@ 2007-11-23 20:27   ` Johannes Berg
  2007-11-23 21:56     ` Johannes Berg
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2007-11-23 20:27 UTC (permalink / raw)
  To: Michael Buesch; +Cc: linux-wireless

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


> > --- everything.orig/drivers/net/wireless/b43/xmit.c	2007-11-22 23:36:05.668676810 +0100
> > +++ everything/drivers/net/wireless/b43/xmit.c	2007-11-22 23:36:22.668677190 +0100
> > @@ -489,7 +489,6 @@ void b43_rx(struct b43_wldev *dev, struc
> >  	}
> >  	wlhdr = (struct ieee80211_hdr *)(skb->data);
> >  	fctl = le16_to_cpu(wlhdr->frame_control);
> > -	skb_trim(skb, skb->len - FCS_LEN);
> >  
> >  	if (macstat & B43_RX_MAC_DEC) {
> >  		unsigned int keyidx;
> > 
> > 
> > 
> > 
> 
> Does this work with all encryption and non-encryption modes?
> There was a crypto related reason why we snipped off the FCS.
> Maybe that's gone, though.

Yeah there was but to be honest I couldn't think of the reason any more
and I can't see one here because right afterwards the only thing we do
is hand the frame to mac80211.

johannes

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

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

* Re: [PATCH] b43: include FCS in frames handed to mac80211
  2007-11-23 20:27   ` Johannes Berg
@ 2007-11-23 21:56     ` Johannes Berg
  0 siblings, 0 replies; 5+ messages in thread
From: Johannes Berg @ 2007-11-23 21:56 UTC (permalink / raw)
  To: Michael Buesch; +Cc: linux-wireless

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


On Fri, 2007-11-23 at 21:27 +0100, Johannes Berg wrote:
> > > --- everything.orig/drivers/net/wireless/b43/xmit.c	2007-11-22 23:36:05.668676810 +0100
> > > +++ everything/drivers/net/wireless/b43/xmit.c	2007-11-22 23:36:22.668677190 +0100
> > > @@ -489,7 +489,6 @@ void b43_rx(struct b43_wldev *dev, struc
> > >  	}
> > >  	wlhdr = (struct ieee80211_hdr *)(skb->data);
> > >  	fctl = le16_to_cpu(wlhdr->frame_control);
> > > -	skb_trim(skb, skb->len - FCS_LEN);
> > >  
> > >  	if (macstat & B43_RX_MAC_DEC) {
> > >  		unsigned int keyidx;
> > > 
> > > 
> > > 
> > > 
> > 
> > Does this work with all encryption and non-encryption modes?
> > There was a crypto related reason why we snipped off the FCS.
> > Maybe that's gone, though.
> 
> Yeah there was but to be honest I couldn't think of the reason any more
> and I can't see one here because right afterwards the only thing we do
> is hand the frame to mac80211.

Ah, I remember now. We were doing "device hides WEP" and snipped off the
ICV so didn't want to move around the FCS.

johannes

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

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

* [PATCH] b43: include FCS in frames handed to mac80211
@ 2007-11-24 14:06 Michael Buesch
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Buesch @ 2007-11-24 14:06 UTC (permalink / raw)
  To: John Linville; +Cc: Johannes Berg, linux-wireless, bcm43xx-dev

From: Johannes Berg <johannes@sipsolutions.net>

Sometimes it can be useful to see the FCS, especially when
bad-FCS frames are shown. Pass the FCS to mac80211 and let
it worry about snipping it off when required.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Michael Buesch <mb@bu3sch.de>

---
 drivers/net/wireless/b43/main.c |    3 ++-
 drivers/net/wireless/b43/xmit.c |    1 -
 2 files changed, 2 insertions(+), 2 deletions(-)

--- everything.orig/drivers/net/wireless/b43/main.c	2007-11-22 23:35:41.208716199 +0100
+++ everything/drivers/net/wireless/b43/main.c	2007-11-22 23:36:03.138677951 +0100
@@ -4158,7 +4158,8 @@ static int b43_wireless_init(struct ssb_
 	}
 
 	/* fill hw info */
-	hw->flags = IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE;
+	hw->flags = IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE |
+		    IEEE80211_HW_RX_INCLUDES_FCS;
 	hw->max_signal = 100;
 	hw->max_rssi = -110;
 	hw->max_noise = -110;
--- everything.orig/drivers/net/wireless/b43/xmit.c	2007-11-22 23:36:05.668676810 +0100
+++ everything/drivers/net/wireless/b43/xmit.c	2007-11-22 23:36:22.668677190 +0100
@@ -489,7 +489,6 @@ void b43_rx(struct b43_wldev *dev, struc
 	}
 	wlhdr = (struct ieee80211_hdr *)(skb->data);
 	fctl = le16_to_cpu(wlhdr->frame_control);
-	skb_trim(skb, skb->len - FCS_LEN);
 
 	if (macstat & B43_RX_MAC_DEC) {
 		unsigned int keyidx;




-------------------------------------------------------

-- 
Greetings Michael.

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

end of thread, other threads:[~2007-11-24 14:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-24 14:06 [PATCH] b43: include FCS in frames handed to mac80211 Michael Buesch
  -- strict thread matches above, loose matches on Subject: below --
2007-11-23 10:46 Johannes Berg
2007-11-23 13:51 ` Michael Buesch
2007-11-23 20:27   ` Johannes Berg
2007-11-23 21:56     ` Johannes Berg

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