2011-01-20 09:37:25

by Alexander Simon

[permalink] [raw]
Subject: [RFC 4/4] mac80211: support for IEEE80211N in IBSS

This adds some ifs to let the packet aggregation also
work while being in IBSS mode.


diff -Nrup compat-wireless-2011-01-17.1/net/mac80211/agg-rx.c
compat-wireless-2011-01-17/net/mac80211/agg-rx.c
--- compat-wireless-2011-01-17.1/net/mac80211/agg-rx.c 2011-01-17
21:03:25.000000000 +0100
+++ compat-wireless-2011-01-17/net/mac80211/agg-rx.c 2011-01-19
17:40:36.000000000 +0100
@@ -160,6 +160,8 @@ static void ieee80211_send_addba_resp(st
memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN);
else if (sdata->vif.type == NL80211_IFTYPE_STATION)
memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN);
+ else if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
+ memcpy(mgmt->bssid, sdata->u.ibss.bssid, ETH_ALEN);

mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
IEEE80211_STYPE_ACTION);
diff -Nrup compat-wireless-2011-01-17.1/net/mac80211/agg-tx.c
compat-wireless-2011-01-17/net/mac80211/agg-tx.c
--- compat-wireless-2011-01-17.1/net/mac80211/agg-tx.c 2011-01-17
21:03:25.000000000 +0100
+++ compat-wireless-2011-01-17/net/mac80211/agg-tx.c 2011-01-19
17:40:36.000000000 +0100
@@ -83,6 +83,8 @@ static void ieee80211_send_addba_request
memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN);
else if (sdata->vif.type == NL80211_IFTYPE_STATION)
memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN);
+ else if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
+ memcpy(mgmt->bssid, sdata->u.ibss.bssid, ETH_ALEN);

mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
IEEE80211_STYPE_ACTION);
@@ -376,7 +378,8 @@ int ieee80211_start_tx_ba_session(struct
*/
if (sdata->vif.type != NL80211_IFTYPE_STATION &&
sdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
- sdata->vif.type != NL80211_IFTYPE_AP)
+ sdata->vif.type != NL80211_IFTYPE_AP &&
+ sdata->vif.type != NL80211_IFTYPE_ADHOC)
return -EINVAL;

if (test_sta_flags(sta, WLAN_STA_BLOCK_BA)) {
diff -Nrup compat-wireless-2011-01-17.1/net/mac80211/ht.c
compat-wireless-2011-01-17/net/mac80211/ht.c
--- compat-wireless-2011-01-17.1/net/mac80211/ht.c
2011-01-17 21:03:25.000000000
+0100
+++ compat-wireless-2011-01-17/net/mac80211/ht.c
2011-01-19 17:40:36.000000000 +0100
@@ -179,6 +179,8 @@ void ieee80211_send_delba(struct ieee802
memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN);
else if (sdata->vif.type == NL80211_IFTYPE_STATION)
memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN);
+ else if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
+ memcpy(mgmt->bssid, sdata->u.ibss.bssid, ETH_ALEN);

mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
IEEE80211_STYPE_ACTION);
diff -Nrup compat-wireless-2011-01-17.1/net/mac80211/rx.c
compat-wireless-2011-01-17/net/mac80211/rx.c
--- compat-wireless-2011-01-17.1/net/mac80211/rx.c
2011-01-17 21:03:26.000000000
+0100
+++ compat-wireless-2011-01-17/net/mac80211/rx.c
2011-01-19 17:40:36.000000000 +0100
@@ -2063,7 +2063,8 @@ ieee80211_rx_h_action(struct ieee80211_r
*/
if (sdata->vif.type != NL80211_IFTYPE_STATION &&
sdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
- sdata->vif.type != NL80211_IFTYPE_AP)
+ sdata->vif.type != NL80211_IFTYPE_AP &&
+ sdata->vif.type != NL80211_IFTYPE_ADHOC)
break;

/* verify action_code is present */




2011-01-20 09:49:49

by Johannes Berg

[permalink] [raw]
Subject: Re: [RFC 4/4] mac80211: support for IEEE80211N in IBSS

On Thu, 2011-01-20 at 09:37 +0000, Alexander Simon wrote:
> This adds some ifs to let the packet aggregation also
> work while being in IBSS mode.
>

Ok this one's a pretty well-split up patch, but

* the subject should be more specific, like
"mac80211: allow aggregation in IBSS mode"
* the description should be more results-oriented,
for example: "Allow aggregation sessions to be
started in IBSS mode." The stuff about "add ifs"
really isn't necessary we can all look at the code :-)
* you missed Signed-off-by
* your patch was line-wrapped, so it can't be applied

As for the other three patches, I don't think they were split up well --
the first one should be cfg80211 specific, and 2/3 should probably be
just one patch? Also for patches 1-3 the line wrapping in the commit log
was very awkward, try to stay < 72 characters per line.

However, if you combine 2 and 3, I still think you need a preliminary
patch to do the refactoring between the code that builds the HT IEs for
IBSS and ieee80211_add_ht_ie(). In fact, I notice there's similar code
in ieee80211_build_preq_ies() so a really good refactoring would take
code from both and replace it with a shared version that IBSS becomes
the third user of.

Have you seen
http://wireless.kernel.org/en/developers/Documentation/SubmittingPatches?

Thanks for your effort!

johannes