cfg80211: add support for setting the ad-hoc multicast rate
authorFelix Fietkau <nbd@openwrt.org>
Thu, 11 Nov 2010 14:07:22 +0000 (15:07 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 16 Nov 2010 21:39:08 +0000 (16:39 -0500)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
include/linux/nl80211.h
include/net/cfg80211.h
net/wireless/nl80211.c

index 17c5c8849250e0a6bd7ae705b14fb4fa307f0c43..037b4e498890fc52579f3525c45a57abafd543d7 100644 (file)
@@ -826,6 +826,8 @@ enum nl80211_commands {
  *     the hardware should not be configured to receive on this antenna.
  *     For a more detailed descripton see @NL80211_ATTR_WIPHY_ANTENNA_TX.
  *
+ * @NL80211_ATTR_MCAST_RATE: Multicast tx rate (in 100 kbps) for IBSS
+ *
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
  */
@@ -998,6 +1000,8 @@ enum nl80211_attrs {
        NL80211_ATTR_WIPHY_ANTENNA_TX,
        NL80211_ATTR_WIPHY_ANTENNA_RX,
 
+       NL80211_ATTR_MCAST_RATE,
+
        /* add attributes here, update the policy in nl80211.c */
 
        __NL80211_ATTR_AFTER_LAST,
index 07425e648a095878f814deb5449eb3c6f766c2cb..8fd9eebd0cc98d97e93d5e7b33d51cf270898156 100644 (file)
@@ -923,6 +923,7 @@ struct cfg80211_disassoc_request {
  * @privacy: this is a protected network, keys will be configured
  *     after joining
  * @basic_rates: bitmap of basic rates to use when creating the IBSS
+ * @mcast_rate: multicast tx rate (in 100 kbps)
  */
 struct cfg80211_ibss_params {
        u8 *ssid;
@@ -934,6 +935,7 @@ struct cfg80211_ibss_params {
        u32 basic_rates;
        bool channel_fixed;
        bool privacy;
+       int mcast_rate;
 };
 
 /**
index 5e4dda4c0fd3617ac6f3fae1752ef31ac7ecf91b..6055538422262b1b53f7b4bf68b6ddfe5796439d 100644 (file)
@@ -171,6 +171,8 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
 
        [NL80211_ATTR_WIPHY_ANTENNA_TX] = { .type = NLA_U32 },
        [NL80211_ATTR_WIPHY_ANTENNA_RX] = { .type = NLA_U32 },
+
+       [NL80211_ATTR_MCAST_RATE] = { .type = NLA_U32 },
 };
 
 /* policy for the key attributes */
@@ -3681,6 +3683,9 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info)
                                return -EINVAL;
                }
        }
+       if (info->attrs[NL80211_ATTR_MCAST_RATE])
+               ibss.mcast_rate =
+                       nla_get_u32(info->attrs[NL80211_ATTR_MCAST_RATE]);
 
        if (ibss.privacy && info->attrs[NL80211_ATTR_KEYS]) {
                connkeys = nl80211_parse_connkeys(rdev,