* [PATCHv2 2/2] mac80211: implement set_mcast_rate() callback
2012-10-15 15:27 [PATCHv2 1/2] nl/cfg80211: add the NL80211_CMD_SET_MCAST_RATE command Antonio Quartulli
@ 2012-10-15 15:27 ` Antonio Quartulli
0 siblings, 0 replies; 3+ messages in thread
From: Antonio Quartulli @ 2012-10-15 15:27 UTC (permalink / raw)
To: Johannes Berg; +Cc: John W. Linville, linux-wireless, Antonio Quartulli
This new callback can be used to tune the rate to be used to send multicast
frames. The callback can be used with vif configured as ADHOC or MESH_POINT
only.
In the current state the multicast rate can be specified on IBSS/MESH joining
only. This makes it impossible to select a custom multicast rate when then join
command is sent by an external program (e.g. wpa_supplicant)
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---
net/mac80211/cfg.c | 7 +++++++
net/mac80211/ieee80211_i.h | 3 +++
net/mac80211/util.c | 12 ++++++++++++
3 files changed, 22 insertions(+)
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index ed27988..21461dc 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1924,6 +1924,12 @@ static int ieee80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev)
return ieee80211_ibss_leave(IEEE80211_DEV_TO_SUB_IF(dev));
}
+static int ieee80211_set_mcast_rate(struct wiphy *wiphy, struct net_device *dev,
+ int rate[IEEE80211_NUM_BANDS])
+{
+ return ieee80211_mcast_rate(IEEE80211_DEV_TO_SUB_IF(dev), rate);
+}
+
static int ieee80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
{
struct ieee80211_local *local = wiphy_priv(wiphy);
@@ -3123,6 +3129,7 @@ struct cfg80211_ops mac80211_config_ops = {
.disassoc = ieee80211_disassoc,
.join_ibss = ieee80211_join_ibss,
.leave_ibss = ieee80211_leave_ibss,
+ .set_mcast_rate = ieee80211_set_mcast_rate,
.set_wiphy_params = ieee80211_set_wiphy_params,
.set_tx_power = ieee80211_set_tx_power,
.get_tx_power = ieee80211_get_tx_power,
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 78c4bbb..e3b9eff 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1575,6 +1575,9 @@ void ieee80211_vif_release_channel(struct ieee80211_sub_if_data *sdata);
void ieee80211_recalc_smps_chanctx(struct ieee80211_local *local,
struct ieee80211_chanctx *chanctx);
+int ieee80211_mcast_rate(struct ieee80211_sub_if_data *sdata,
+ int rate[IEEE80211_NUM_BANDS]);
+
#ifdef CONFIG_MAC80211_NOINLINE
#define debug_noinline noinline
#else
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 350b7a7..c9f6813 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1959,3 +1959,15 @@ u8 ieee80211_mcs_to_chains(const struct ieee80211_mcs_info *mcs)
return 2;
return 1;
}
+
+int ieee80211_mcast_rate(struct ieee80211_sub_if_data *sdata,
+ int rate[IEEE80211_NUM_BANDS])
+{
+ if (sdata->vif.type != NL80211_IFTYPE_ADHOC &&
+ sdata->vif.type != NL80211_IFTYPE_MESH_POINT)
+ return -EOPNOTSUPP;
+
+ memcpy(sdata->vif.bss_conf.mcast_rate, &rate, sizeof(rate));
+
+ return 0;
+}
--
1.7.12.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCHv2 2/2] mac80211: implement set_mcast_rate() callback
@ 2012-10-19 11:24 Yeoh Chun-Yeow
2012-10-19 11:28 ` Antonio Quartulli
0 siblings, 1 reply; 3+ messages in thread
From: Yeoh Chun-Yeow @ 2012-10-19 11:24 UTC (permalink / raw)
To: ordex; +Cc: Johannes Berg, John Linville, linux-wireless
Hi, Antonio
> + memcpy(sdata->vif.bss_conf.mcast_rate, &rate, sizeof(rate));
I think that the second argument should be "rate" instead of "&rate".
---
Chun-Yeow
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCHv2 2/2] mac80211: implement set_mcast_rate() callback
2012-10-19 11:24 [PATCHv2 2/2] mac80211: implement set_mcast_rate() callback Yeoh Chun-Yeow
@ 2012-10-19 11:28 ` Antonio Quartulli
0 siblings, 0 replies; 3+ messages in thread
From: Antonio Quartulli @ 2012-10-19 11:28 UTC (permalink / raw)
To: Yeoh Chun-Yeow; +Cc: Johannes Berg, John Linville, linux-wireless
[-- Attachment #1: Type: text/plain, Size: 383 bytes --]
On Fri, Oct 19, 2012 at 07:24:34PM +0800, Yeoh Chun-Yeow wrote:
> Hi, Antonio
>
> > + memcpy(sdata->vif.bss_conf.mcast_rate, &rate, sizeof(rate));
>
> I think that the second argument should be "rate" instead of "&rate".
Hi Yeoh,
correct. Thanks a lot!
>
> ---
> Chun-Yeow
--
Antonio Quartulli
..each of us alone is worth nothing..
Ernesto "Che" Guevara
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-10-19 11:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-19 11:24 [PATCHv2 2/2] mac80211: implement set_mcast_rate() callback Yeoh Chun-Yeow
2012-10-19 11:28 ` Antonio Quartulli
-- strict thread matches above, loose matches on Subject: below --
2012-10-15 15:27 [PATCHv2 1/2] nl/cfg80211: add the NL80211_CMD_SET_MCAST_RATE command Antonio Quartulli
2012-10-15 15:27 ` [PATCHv2 2/2] mac80211: implement set_mcast_rate() callback Antonio Quartulli
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).