From: Alexander Simon <alexander.simon@saxnet.de>
To: linux-wireless@vger.kernel.org
Subject: [RFC 3/4] mac80211: support for IEEE80211N in IBSS
Date: Thu, 20 Jan 2011 09:26:30 +0000 (UTC) [thread overview]
Message-ID: <loom.20110120T102202-752@post.gmane.org> (raw)
In-Reply-To: 1295447708.4685.5.camel@jlt3.sipsolutions.net
Parse a new stations HT IE.
ieee80211_ibss_add_sta is called with a new argument, ht capabilities of that
new station.
Luckily there was that function ieee80211_ht_cap_ie_to_sta_ht_cap that is
called. This inserts these HT capabilities into the sta_info struct that is eg
used by the rate algorithm.
As mentioned before, this parameter will be NULL when called from rx.c (main
receive path).
diff -Nrup compat-wireless-2011-01-17.2/net/mac80211/ibss.c
compat-wireless-2011-01-17.3//net/mac80211/ibss.c
--- compat-wireless-2011-01-17.2/net/mac80211/ibss.c 2011-01-20
10:02:16.000000000 +0100
+++ compat-wireless-2011-01-17.3//net/mac80211/ibss.c 2011-01-20
10:03:11.000000000 +0100
@@ -391,7 +391,7 @@ static void ieee80211_rx_bss_info(struct
}
} else
sta = ieee80211_ibss_add_sta(sdata, mgmt->bssid,
- mgmt->sa, supp_rates,
+ mgmt->sa, supp_rates, elems->ht_cap_elem,
GFP_ATOMIC);
}
@@ -490,7 +490,7 @@ static void ieee80211_rx_bss_info(struct
ieee80211_sta_join_ibss(sdata, bss);
supp_rates = ieee80211_sta_get_rates(local, elems, band);
ieee80211_ibss_add_sta(sdata, mgmt->bssid, mgmt->sa,
- supp_rates, GFP_KERNEL);
+ supp_rates, elems->ht_cap_elem, GFP_KERNEL);
}
put_bss:
@@ -503,8 +503,8 @@ static void ieee80211_rx_bss_info(struct
* must be callable in atomic context.
*/
struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata,
- u8 *bssid,u8 *addr, u32 supp_rates,
- gfp_t gfp)
+ u8 *bssid, u8 *addr, u32 supp_rates,
+ struct ieee80211_ht_cap *ht_cap, gfp_t gfp)
{
struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
struct ieee80211_local *local = sdata->local;
@@ -544,6 +544,10 @@ struct sta_info *ieee80211_ibss_add_sta(
sta->sta.supp_rates[band] = supp_rates |
ieee80211_mandatory_rates(local, band);
+ if (ht_cap)
+ ieee80211_ht_cap_ie_to_sta_ht_cap(local->hw.wiphy->bands[band],
+ ht_cap, &sta->sta.ht_cap);
+
rate_control_rate_init(sta);
/* If it fails, maybe we raced another insertion? */
diff -Nrup compat-wireless-2011-01-17.2/net/mac80211/ieee80211_i.h
compat-wireless-2011-01-17.3//net/mac80211/ieee80211_i.h
--- compat-wireless-2011-01-17.2/net/mac80211/ieee80211_i.h 2011-01-20
10:01:56.000000000 +0100
+++ compat-wireless-2011-01-17.3//net/mac80211/ieee80211_i.h 2011-01-20
10:03:11.000000000 +0100
@@ -1111,7 +1111,7 @@ void ieee80211_ibss_notify_scan_complete
void ieee80211_ibss_setup_sdata(struct ieee80211_sub_if_data *sdata);
struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata,
u8 *bssid, u8 *addr, u32 supp_rates,
- gfp_t gfp);
+ struct ieee80211_ht_cap *ht_cap, gfp_t gfp);
int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata,
struct cfg80211_ibss_params *params);
int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata);
diff -Nrup compat-wireless-2011-01-17.2/net/mac80211/rx.c
compat-wireless-2011-01-17.3//net/mac80211/rx.c
--- compat-wireless-2011-01-17.2/net/mac80211/rx.c 2011-01-17 21:03:26.000000000
+0100
+++ compat-wireless-2011-01-17.3//net/mac80211/rx.c 2011-01-20
10:03:11.000000000 +0100
@@ -2618,7 +2618,7 @@ static int prepare_for_handlers(struct i
else
rate_idx = status->rate_idx;
rx->sta = ieee80211_ibss_add_sta(sdata, bssid,
- hdr->addr2, BIT(rate_idx), GFP_ATOMIC);
+ hdr->addr2, BIT(rate_idx), NULL, GFP_ATOMIC);
}
break;
case NL80211_IFTYPE_MESH_POINT:
next prev parent reply other threads:[~2011-01-20 9:30 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-19 13:38 [RFC] mac80211: support for IEEE80211N in IBSS Alexander Simon
2011-01-19 14:35 ` Johannes Berg
2011-01-20 9:10 ` [RFC 1/4] " Alexander Simon
2011-01-20 9:24 ` Johannes Berg
2011-01-20 9:48 ` Alexander Simon
2011-01-20 9:54 ` Johannes Berg
2011-01-20 10:15 ` Alexander Simon
2011-01-20 10:20 ` Johannes Berg
2011-01-20 9:21 ` [RFC 2/4] " Alexander Simon
2011-01-20 9:26 ` Alexander Simon [this message]
2011-01-20 9:37 ` [RFC 4/4] " Alexander Simon
2011-01-20 9:49 ` Johannes Berg
2011-01-26 16:31 ` [RFC] " Baldomero Coll
2011-02-03 10:59 ` Baldomero Coll
2011-02-04 17:10 ` Baldomero Coll
2011-02-04 17:22 ` Brian Prodoehl
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=loom.20110120T102202-752@post.gmane.org \
--to=alexander.simon@saxnet.de \
--cc=linux-wireless@vger.kernel.org \
/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).