Commit 885a46d0 authored by Felix Fietkau's avatar Felix Fietkau Committed by John W. Linville

cfg80211: add support for setting the ad-hoc multicast rate

Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent a619a4c0
...@@ -826,6 +826,8 @@ enum nl80211_commands { ...@@ -826,6 +826,8 @@ enum nl80211_commands {
* the hardware should not be configured to receive on this antenna. * the hardware should not be configured to receive on this antenna.
* For a more detailed descripton see @NL80211_ATTR_WIPHY_ANTENNA_TX. * 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_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use * @__NL80211_ATTR_AFTER_LAST: internal use
*/ */
...@@ -998,6 +1000,8 @@ enum nl80211_attrs { ...@@ -998,6 +1000,8 @@ enum nl80211_attrs {
NL80211_ATTR_WIPHY_ANTENNA_TX, NL80211_ATTR_WIPHY_ANTENNA_TX,
NL80211_ATTR_WIPHY_ANTENNA_RX, NL80211_ATTR_WIPHY_ANTENNA_RX,
NL80211_ATTR_MCAST_RATE,
/* add attributes here, update the policy in nl80211.c */ /* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST, __NL80211_ATTR_AFTER_LAST,
......
...@@ -923,6 +923,7 @@ struct cfg80211_disassoc_request { ...@@ -923,6 +923,7 @@ struct cfg80211_disassoc_request {
* @privacy: this is a protected network, keys will be configured * @privacy: this is a protected network, keys will be configured
* after joining * after joining
* @basic_rates: bitmap of basic rates to use when creating the IBSS * @basic_rates: bitmap of basic rates to use when creating the IBSS
* @mcast_rate: multicast tx rate (in 100 kbps)
*/ */
struct cfg80211_ibss_params { struct cfg80211_ibss_params {
u8 *ssid; u8 *ssid;
...@@ -934,6 +935,7 @@ struct cfg80211_ibss_params { ...@@ -934,6 +935,7 @@ struct cfg80211_ibss_params {
u32 basic_rates; u32 basic_rates;
bool channel_fixed; bool channel_fixed;
bool privacy; bool privacy;
int mcast_rate;
}; };
/** /**
......
...@@ -171,6 +171,8 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = { ...@@ -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_TX] = { .type = NLA_U32 },
[NL80211_ATTR_WIPHY_ANTENNA_RX] = { .type = NLA_U32 }, [NL80211_ATTR_WIPHY_ANTENNA_RX] = { .type = NLA_U32 },
[NL80211_ATTR_MCAST_RATE] = { .type = NLA_U32 },
}; };
/* policy for the key attributes */ /* policy for the key attributes */
...@@ -3681,6 +3683,9 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info) ...@@ -3681,6 +3683,9 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info)
return -EINVAL; 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]) { if (ibss.privacy && info->attrs[NL80211_ATTR_KEYS]) {
connkeys = nl80211_parse_connkeys(rdev, connkeys = nl80211_parse_connkeys(rdev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment