From: "Tomas Winkler" <tomasw@gmail.com>
To: "Johannes Berg" <johannes@sipsolutions.net>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
"Ron Rindjunsky" <ron.rindjunsky@intel.com>,
"Michael Buesch" <mb@bu3sch.de>,
"Ivo van Doorn" <ivdoorn@gmail.com>,
"Michael Wu" <flamingice@sourmilk.net>,
"Luis R. Rodriguez" <mcgrof@gmail.com>,
"bruno randolf" <br1@einfach.org>,
"Nick Kossifidis" <mickflemm@gmail.com>,
"Yanbo Li" <dreamfly281@gmail.com>,
"Stefano Brivio" <stefano.brivio@polimi.it>,
"Zhu Yi" <yi.zhu@intel.com>,
"Reinette Chatre" <reinette.chatre@intel.com>,
"Daniel Drake" <dsd@gentoo.org>
Subject: Re: [RFC] mac80211: proper short-slot handling
Date: Thu, 10 Jan 2008 17:16:40 +0200 [thread overview]
Message-ID: <1ba2fa240801100716w21746eb9sa555fbeeb79cf174@mail.gmail.com> (raw)
In-Reply-To: <1199974496.3861.80.camel@johannes.berg>
On Jan 10, 2008 4:14 PM, Johannes Berg <johannes@sipsolutions.net> wrote:
> Sorry about the long CC list, I wanted all driver people to be aware.
>
> I really need help converting drivers, I attempted a few but without
> understanding the hardware it's not easy to pull off. First though, we
> should discuss whether this patch is the right approach. Any comments?
>
> If you think it is the right approach, maybe try converting your driver
> and see if that results in any problems, if not, send me the patch and
> I'll integrate it.
>
> If, on the other hand, you think the current mechanism is appropriate,
> we'll have to fix the bugs with it in another way.
>
> This patch probably depends on my cfg80211 rate API patch thought it
> might apply without it.
>
> johannes
>
>
> From: Johannes Berg <johannes@sipsolutions.net>
>
> When associated, we should enable/disable short slot timing
> as required. This patch adds short slot timing to the BSS
> configuration and removes it from the hw configuration.
>
> NOT-signed-off-by: Johannes Berg <johannes@sipsolutions.net>
>
> --- everything.orig/include/net/mac80211.h 2008-01-10 00:48:42.900223796 +0100
> +++ everything/include/net/mac80211.h 2008-01-10 15:07:00.369166504 +0100
> @@ -172,11 +172,13 @@ struct ieee80211_low_level_stats {
> * also implies a change in the AID.
> * @BSS_CHANGED_ERP_CTS_PROT: CTS protection changed
> * @BSS_CHANGED_ERP_PREAMBLE: preamble changed
> + * @BSS_CHANGED_ERP_SLOT: slot timing changed
> */
> enum ieee80211_bss_change {
> BSS_CHANGED_ASSOC = 1<<0,
> BSS_CHANGED_ERP_CTS_PROT = 1<<1,
> BSS_CHANGED_ERP_PREAMBLE = 1<<2,
> + BSS_CHANGED_ERP_SLOT = 1<<3,
> };
>
> /**
> @@ -189,6 +191,7 @@ enum ieee80211_bss_change {
> * @aid: association ID number, valid only when @assoc is true
> * @use_cts_prot: use CTS protection
> * @use_short_preamble: use 802.11b short preamble
> + * @use_short_slot: use short slot time (only relevant for ERP)
> */
> struct ieee80211_bss_conf {
> /* association related data */
> @@ -197,6 +200,7 @@ struct ieee80211_bss_conf {
> /* erp related data */
> bool use_cts_prot;
> bool use_short_preamble;
> + bool use_short_slot;
> };
>
> /* Transmit control fields. This data structure is passed to low-level driver
> @@ -364,14 +368,12 @@ struct ieee80211_tx_status {
> *
> * Flags to define PHY configuration options
> *
> - * @IEEE80211_CONF_SHORT_SLOT_TIME: use 802.11g short slot time
> * @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported)
> * @IEEE80211_CONF_SUPPORT_HT_MODE: use 802.11n HT capabilities (if supported)
> */
> enum ieee80211_conf_flags {
> - IEEE80211_CONF_SHORT_SLOT_TIME = (1<<0),
> - IEEE80211_CONF_RADIOTAP = (1<<1),
> - IEEE80211_CONF_SUPPORT_HT_MODE = (1<<2),
> + IEEE80211_CONF_RADIOTAP = (1<<0),
> + IEEE80211_CONF_SUPPORT_HT_MODE = (1<<1),
> };
>
> /**
> --- everything.orig/net/mac80211/ieee80211_sta.c 2008-01-10 00:48:42.940223199 +0100
> +++ everything/net/mac80211/ieee80211_sta.c 2008-01-10 15:07:00.559168023 +0100
> @@ -313,8 +313,8 @@ static void ieee80211_sta_wmm_params(str
> }
>
>
> -static u32 ieee80211_handle_erp_ie(struct ieee80211_sub_if_data *sdata,
> - u8 erp_value)
> +static u32 ieee80211_handle_erp(struct ieee80211_sub_if_data *sdata,
> + u8 erp_value, bool short_slot)
> {
> struct ieee80211_bss_conf *bss_conf = &sdata->bss_conf;
> struct ieee80211_if_sta *ifsta = &sdata->u.sta;
> @@ -348,6 +348,13 @@ static u32 ieee80211_handle_erp_ie(struc
> changed |= BSS_CHANGED_ERP_PREAMBLE;
> }
>
> + short_slot = !!short_slot;
> +
> + if (short_slot != bss_conf->use_short_slot) {
> + bss_conf->use_short_slot = short_slot;
> + changed |= BSS_CHANGED_ERP_SLOT;
> + }
> +
> return changed;
> }
>
> @@ -469,9 +476,13 @@ static void ieee80211_set_associated(str
> local->hw.conf.channel->center_freq,
> ifsta->ssid, ifsta->ssid_len);
> if (bss) {
> + bool short_slot =
> + bss->capability & WLAN_CAPABILITY_SHORT_SLOT_TIME;
> +
> if (bss->has_erp_value)
> - changed |= ieee80211_handle_erp_ie(
> - sdata, bss->erp_value);
> + changed |= ieee80211_handle_erp(
> + sdata, bss->erp_value,
> + short_slot);
> ieee80211_rx_bss_put(dev, bss);
> }
>
> @@ -2139,8 +2150,14 @@ static void ieee80211_rx_mgmt_beacon(str
>
> ieee802_11_parse_elems(mgmt->u.beacon.variable, len - baselen, &elems);
>
> - if (elems.erp_info && elems.erp_info_len >= 1)
> - changed |= ieee80211_handle_erp_ie(sdata, elems.erp_info[0]);
> + if (elems.erp_info && elems.erp_info_len >= 1) {
> + bool short_slot =
> + mgmt->u.beacon.capab_info &
> + cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT_TIME);
> +
> + changed |= ieee80211_handle_erp(sdata, elems.erp_info[0],
> + short_slot);
> + }
>
> if (elems.ht_cap_elem && elems.ht_info_elem &&
> elems.wmm_param && local->ops->conf_ht &&
>
>
>
It looks fine to me. I'll supply patch for iwlwifi
Thanks
Tomas
next prev parent reply other threads:[~2008-01-10 15:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-10 14:14 [RFC] mac80211: proper short-slot handling Johannes Berg
2008-01-10 15:16 ` Tomas Winkler [this message]
2008-01-10 17:25 ` Ivo van Doorn
2008-01-10 19:00 ` Ivo van Doorn
2008-01-16 13:30 ` Johannes Berg
2008-01-16 16:37 ` Ivo van Doorn
2008-01-16 16:41 ` Johannes Berg
2008-01-16 16:51 ` Ivo van Doorn
2008-01-22 20:26 ` Tomas Winkler
2008-01-24 8:38 ` Johannes Berg
2008-01-24 15:17 ` Tomas Winkler
2008-01-24 15:37 ` Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1ba2fa240801100716w21746eb9sa555fbeeb79cf174@mail.gmail.com \
--to=tomasw@gmail.com \
--cc=br1@einfach.org \
--cc=dreamfly281@gmail.com \
--cc=dsd@gentoo.org \
--cc=flamingice@sourmilk.net \
--cc=ivdoorn@gmail.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=mb@bu3sch.de \
--cc=mcgrof@gmail.com \
--cc=mickflemm@gmail.com \
--cc=reinette.chatre@intel.com \
--cc=ron.rindjunsky@intel.com \
--cc=stefano.brivio@polimi.it \
--cc=yi.zhu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).