linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mac80211: correct use_short_preamble handling
@ 2008-03-31 15:05 Vladimir Koutny
  2008-03-31 16:20 ` Tomas Winkler
  0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Koutny @ 2008-03-31 15:05 UTC (permalink / raw)
  To: linux-wireless, Michael Wu, Johannes Berg, Jiri Benc

ERP IE bit for preamble mode is 0 for short and 1 for long, not the other
way around. This fixes the value reported to the driver via
bss_conf->use_short_preamble field.

Signed-off-by: Vladimir Koutny <vlado@ksp.sk>

---
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
index f9cf2f1..6fb179a 100644
--- a/net/mac80211/ieee80211_sta.c
+++ b/net/mac80211/ieee80211_sta.c
@@ -360,7 +360,7 @@ static u32 ieee80211_handle_erp_ie(struct ieee80211_sub_if_data *sdata,
 	struct ieee80211_bss_conf *bss_conf = &sdata->bss_conf;
 	struct ieee80211_if_sta *ifsta = &sdata->u.sta;
 	bool use_protection = (erp_value & WLAN_ERP_USE_PROTECTION) != 0;
-	bool preamble_mode = (erp_value & WLAN_ERP_BARKER_PREAMBLE) != 0;
+	bool use_short_preamble = (erp_value & WLAN_ERP_BARKER_PREAMBLE) == 0;
 	DECLARE_MAC_BUF(mac);
 	u32 changed = 0;

@@ -376,16 +376,15 @@ static u32 ieee80211_handle_erp_ie(struct ieee80211_sub_if_data *sdata,
 		changed |= BSS_CHANGED_ERP_CTS_PROT;
 	}

-	if (preamble_mode != bss_conf->use_short_preamble) {
+	if (use_short_preamble != bss_conf->use_short_preamble) {
 		if (net_ratelimit()) {
 			printk(KERN_DEBUG "%s: switched to %s barker preamble"
 			       " (BSSID=%s)\n",
 			       sdata->dev->name,
-			       (preamble_mode == WLAN_ERP_PREAMBLE_SHORT) ?
-					"short" : "long",
+			       use_short_preamble ? "short" : "long",
 			       print_mac(mac, ifsta->bssid));
 		}
-		bss_conf->use_short_preamble = preamble_mode;
+		bss_conf->use_short_preamble = use_short_preamble;
 		changed |= BSS_CHANGED_ERP_PREAMBLE;
 	}


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

* Re: [PATCH 1/2] mac80211: correct use_short_preamble handling
  2008-03-31 15:05 [PATCH 1/2] mac80211: correct use_short_preamble handling Vladimir Koutny
@ 2008-03-31 16:20 ` Tomas Winkler
  0 siblings, 0 replies; 2+ messages in thread
From: Tomas Winkler @ 2008-03-31 16:20 UTC (permalink / raw)
  To: Vladimir Koutny; +Cc: linux-wireless, Michael Wu, Johannes Berg, Jiri Benc

On Mon, Mar 31, 2008 at 6:05 PM, Vladimir Koutny <vlado@work.ksp.sk> wrote:
> ERP IE bit for preamble mode is 0 for short and 1 for long, not the other
> way around. This fixes the value reported to the driver via
> bss_conf->use_short_preamble field.
>
> Signed-off-by: Vladimir Koutny <vlado@ksp.sk>
>
> ---
> diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
> index f9cf2f1..6fb179a 100644
> --- a/net/mac80211/ieee80211_sta.c
> +++ b/net/mac80211/ieee80211_sta.c
> @@ -360,7 +360,7 @@ static u32 ieee80211_handle_erp_ie(struct ieee80211_sub_if_data *sdata,
>        struct ieee80211_bss_conf *bss_conf = &sdata->bss_conf;
>        struct ieee80211_if_sta *ifsta = &sdata->u.sta;
>        bool use_protection = (erp_value & WLAN_ERP_USE_PROTECTION) != 0;
> -       bool preamble_mode = (erp_value & WLAN_ERP_BARKER_PREAMBLE) != 0;
> +       bool use_short_preamble = (erp_value & WLAN_ERP_BARKER_PREAMBLE) == 0;
>        DECLARE_MAC_BUF(mac);
>        u32 changed = 0;
>
> @@ -376,16 +376,15 @@ static u32 ieee80211_handle_erp_ie(struct ieee80211_sub_if_data *sdata,
>                changed |= BSS_CHANGED_ERP_CTS_PROT;
>        }
>
> -       if (preamble_mode != bss_conf->use_short_preamble) {
> +       if (use_short_preamble != bss_conf->use_short_preamble) {
>                if (net_ratelimit()) {
>                        printk(KERN_DEBUG "%s: switched to %s barker preamble"
>                               " (BSSID=%s)\n",
>                               sdata->dev->name,
> -                              (preamble_mode == WLAN_ERP_PREAMBLE_SHORT) ?
> -                                       "short" : "long",
> +                              use_short_preamble ? "short" : "long",
>                               print_mac(mac, ifsta->bssid));
>                }
> -               bss_conf->use_short_preamble = preamble_mode;
> +               bss_conf->use_short_preamble = use_short_preamble;
>                changed |= BSS_CHANGED_ERP_PREAMBLE;
>        }


ACK
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

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

end of thread, other threads:[~2008-03-31 16:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-31 15:05 [PATCH 1/2] mac80211: correct use_short_preamble handling Vladimir Koutny
2008-03-31 16:20 ` Tomas Winkler

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