mac80211: implement set_mcast_rate() callback
authorAntonio Quartulli <ordex@autistici.org>
Fri, 2 Nov 2012 12:27:49 +0000 (13:27 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 5 Nov 2012 14:54:46 +0000 (15:54 +0100)
This new callback can be used to tune the rate to be used to send
multicast frames.

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>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/cfg.c

index eebb70b0aa117220f14147079f8537cdd8712a98..80e0618b25ba47d7edfd2e5a27a6552ee0a88983 100644 (file)
@@ -1954,6 +1954,16 @@ 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])
+{
+       struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+
+       memcpy(sdata->vif.bss_conf.mcast_rate, rate, sizeof(rate));
+
+       return 0;
+}
+
 static int ieee80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
 {
        struct ieee80211_local *local = wiphy_priv(wiphy);
@@ -3180,6 +3190,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,