2011-02-04 15:36:25

by Mohammed Shafi Shajakhan

[permalink] [raw]
Subject: [RFC] mac80211: Fix parsing of MCS rates to radiotap

From: Mohammed Shafi Shajakhan <[email protected]>

Previously the MCS rate elements were parsed at the wrong position

Signed-off-by: Mohammed Shafi Shajakhan <[email protected]>
---
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



2011-02-04 15:39:09

by Johannes Berg

[permalink] [raw]
Subject: Re: [RFC] mac80211: Fix parsing of MCS rates to radiotap

On Fri, 2011-02-04 at 21:06 +0530, Mohammed Shafi Shajakhan wrote:
> From: Mohammed Shafi Shajakhan <[email protected]>
>
> Previously the MCS rate elements were parsed at the wrong position
>
> Signed-off-by: Mohammed Shafi Shajakhan <[email protected]>
> ---
> 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


2011-02-04 16:01:58

by Mohammed Shafi Shajakhan

[permalink] [raw]
Subject: Re: [RFC] mac80211: Fix parsing of MCS rates to radiotap

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<[email protected]>
>>
>> Previously the MCS rate elements were parsed at the wrong position
>>
>> Signed-off-by: Mohammed Shafi Shajakhan<[email protected]>
>> ---
>> 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
>
>