linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] mac80211: Fix parsing of MCS rates to radiotap
@ 2011-02-04 15:36 Mohammed Shafi Shajakhan
  2011-02-04 15:39 ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Mohammed Shafi Shajakhan @ 2011-02-04 15:36 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, johannes, Mohammed Shafi Shajakhan

From: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>

Previously the MCS rate elements were parsed at the wrong position

Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
---
 net/mac80211/rx.c |   31 ++++++++++---------------------
 1 files changed, 10 insertions(+), 21 deletions(-)

diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index c08b8e9..27b4b1f 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -141,14 +141,16 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
 
 	/* IEEE80211_RADIOTAP_RATE */
 	if (status->flag & RX_FLAG_HT) {
-		/*
-		 * TODO: add following information into radiotap header once
-		 * suitable fields are defined for it:
-		 * - MCS index (status->rate_idx)
-		 * - HT40 (status->flag & RX_FLAG_40MHZ)
-		 * - short-GI (status->flag & RX_FLAG_SHORT_GI)
-		 */
-		*pos = 0;
+		rthdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_MCS);
+		*pos++ = IEEE80211_RADIOTAP_MCS_HAVE_MCS |
+			 IEEE80211_RADIOTAP_MCS_HAVE_GI |
+			 IEEE80211_RADIOTAP_MCS_HAVE_BW;
+		if (status->flag & RX_FLAG_SHORT_GI)
+			*pos |= IEEE80211_RADIOTAP_MCS_SGI;
+		if (status->flag & RX_FLAG_40MHZ)
+			*pos |= IEEE80211_RADIOTAP_MCS_BW_40;
+		pos++;
+		*pos++ = status->rate_idx;
 	} else {
 		rthdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_RATE);
 		*pos = rate->bitrate / 5;
@@ -197,19 +199,6 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
 	put_unaligned_le16(rx_flags, pos);
 	pos += 2;
 
-	if (status->flag & RX_FLAG_HT) {
-		rthdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_MCS);
-		*pos++ = IEEE80211_RADIOTAP_MCS_HAVE_MCS |
-			 IEEE80211_RADIOTAP_MCS_HAVE_GI |
-			 IEEE80211_RADIOTAP_MCS_HAVE_BW;
-		*pos = 0;
-		if (status->flag & RX_FLAG_SHORT_GI)
-			*pos |= IEEE80211_RADIOTAP_MCS_SGI;
-		if (status->flag & RX_FLAG_40MHZ)
-			*pos |= IEEE80211_RADIOTAP_MCS_BW_40;
-		pos++;
-		*pos++ = status->rate_idx;
-	}
 }
 
 /*
-- 
1.7.0.4


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

* Re: [RFC] mac80211: Fix parsing of MCS rates to radiotap
  2011-02-04 15:36 [RFC] mac80211: Fix parsing of MCS rates to radiotap Mohammed Shafi Shajakhan
@ 2011-02-04 15:39 ` Johannes Berg
  2011-02-04 16:01   ` Mohammed Shafi
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2011-02-04 15:39 UTC (permalink / raw)
  To: Mohammed Shafi Shajakhan; +Cc: linville, linux-wireless

On Fri, 2011-02-04 at 21:06 +0530, Mohammed Shafi Shajakhan wrote:
> From: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
> 
> Previously the MCS rate elements were parsed at the wrong position
> 
> Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
> ---
>  net/mac80211/rx.c |   31 ++++++++++---------------------
>  1 files changed, 10 insertions(+), 21 deletions(-)
> 
> diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
> index c08b8e9..27b4b1f 100644
> --- a/net/mac80211/rx.c
> +++ b/net/mac80211/rx.c
> @@ -141,14 +141,16 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
>  
>  	/* IEEE80211_RADIOTAP_RATE */
>  	if (status->flag & RX_FLAG_HT) {
> -		/*
> -		 * TODO: add following information into radiotap header once
> -		 * suitable fields are defined for it:
> -		 * - MCS index (status->rate_idx)
> -		 * - HT40 (status->flag & RX_FLAG_40MHZ)
> -		 * - short-GI (status->flag & RX_FLAG_SHORT_GI)
> -		 */
> -		*pos = 0;

Alright, so I forgot to remove this comment, but what made you think
that I added the code in the wrong place??

totally NAK, this breaks radiotap. Removing the comment there is fine,
replace it with

/*
 * MCS information is a separate field in radiotap,
 * added below.
 */

johannes


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

* Re: [RFC] mac80211: Fix parsing of MCS rates to radiotap
  2011-02-04 15:39 ` Johannes Berg
@ 2011-02-04 16:01   ` Mohammed Shafi
  0 siblings, 0 replies; 3+ messages in thread
From: Mohammed Shafi @ 2011-02-04 16:01 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Mohammed Shajakhan, linville@tuxdriver.com,
	linux-wireless@vger.kernel.org

On Friday 04 February 2011 09:09 PM, Johannes Berg wrote:
> On Fri, 2011-02-04 at 21:06 +0530, Mohammed Shafi Shajakhan wrote:
>    
>> From: Mohammed Shafi Shajakhan<mshajakhan@atheros.com>
>>
>> Previously the MCS rate elements were parsed at the wrong position
>>
>> Signed-off-by: Mohammed Shafi Shajakhan<mshajakhan@atheros.com>
>> ---
>>   net/mac80211/rx.c |   31 ++++++++++---------------------
>>   1 files changed, 10 insertions(+), 21 deletions(-)
>>
>> diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
>> index c08b8e9..27b4b1f 100644
>> --- a/net/mac80211/rx.c
>> +++ b/net/mac80211/rx.c
>> @@ -141,14 +141,16 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
>>
>>   	/* IEEE80211_RADIOTAP_RATE */
>>   	if (status->flag&  RX_FLAG_HT) {
>> -		/*
>> -		 * TODO: add following information into radiotap header once
>> -		 * suitable fields are defined for it:
>> -		 * - MCS index (status->rate_idx)
>> -		 * - HT40 (status->flag&  RX_FLAG_40MHZ)
>> -		 * - short-GI (status->flag&  RX_FLAG_SHORT_GI)
>> -		 */
>> -		*pos = 0;
>>      
> Alright, so I forgot to remove this comment, but what made you think
> that I added the code in the wrong place??
>
> totally NAK, this breaks radiotap. Removing the comment there is fine,
> replace it with
>    
Sure,thanks for the review .
> /*
>   * MCS information is a separate field in radiotap,
>   * added below.
>   */
>
> johannes
>
>    

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

end of thread, other threads:[~2011-02-04 16:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-04 15:36 [RFC] mac80211: Fix parsing of MCS rates to radiotap Mohammed Shafi Shajakhan
2011-02-04 15:39 ` Johannes Berg
2011-02-04 16:01   ` Mohammed Shafi

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