2008-03-27 13:22:28

by Vladimir Koutny

[permalink] [raw]
Subject: mac80211: bad use of bss_conf.use_short_preamble

Hi,
does anyone know what values were intended to be used for
bss_conf.use_short_preamble? The way it is handled now is not
optimal for sure:

/* WLAN_ERP_BARKER_PREAMBLE values */
enum {
WLAN_ERP_PREAMBLE_SHORT = 0,
WLAN_ERP_PREAMBLE_LONG = 1,
};

ieee80211_reset_erp_info():
sdata->bss_conf.use_short_preamble = 0;

ieee80211_frame_duration():
dur += short_preamble ? (72 + 24) : (144 + 48);

ieee80211_handle_erp_ie():
printk(KERN_DEBUG "%s: switched to %s barker preamble"
" (BSSID=%s)\n",
sdata->dev->name,
(preamble_mode == WLAN_ERP_PREAMBLE_SHORT) ?
"short" : "long",
print_mac(mac, ifsta->bssid));


In short, the value driver receives in bss_info_changed() callback
uses WLAN_ERP_PREAMBLE_xxx constants, but ie. frame_duration() uses
0=long, 1=short semantics (reset_erp_info() probably wants to set
long preambles as well). There are more places like this I suppose.

My reason for looking at this is that if you associate to 11b AP,
the value of use_short_preamble is not set correctly - seems that
it is set only based on ERP IE and not based on capability info.
However I'm not sure yet if this is related to above inconsistency
or not, I have to dig into it.

Regards,
Vlado




Attachments:
signature.asc (370.00 B)
OpenPGP digital signature

2008-03-27 13:41:14

by Johannes Berg

[permalink] [raw]
Subject: Re: mac80211: bad use of bss_conf.use_short_preamble


> does anyone know what values were intended to be used for
> bss_conf.use_short_preamble? The way it is handled now is not
> optimal for sure:

Huh, I guess we screwed that up when converting it to bss_conf. The
WLAN_ERP_... values shouldn't be used internally nor with the driver and
be converted to the bool value.

johannes


Attachments:
signature.asc (828.00 B)
This is a digitally signed message part