diff options
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r-- | net/wireless/nl80211.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index e3bee3cecdfa..c09fbcd278fb 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -69,6 +69,7 @@ static struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] __read_mostly = { | |||
69 | [NL80211_ATTR_WIPHY_RETRY_LONG] = { .type = NLA_U8 }, | 69 | [NL80211_ATTR_WIPHY_RETRY_LONG] = { .type = NLA_U8 }, |
70 | [NL80211_ATTR_WIPHY_FRAG_THRESHOLD] = { .type = NLA_U32 }, | 70 | [NL80211_ATTR_WIPHY_FRAG_THRESHOLD] = { .type = NLA_U32 }, |
71 | [NL80211_ATTR_WIPHY_RTS_THRESHOLD] = { .type = NLA_U32 }, | 71 | [NL80211_ATTR_WIPHY_RTS_THRESHOLD] = { .type = NLA_U32 }, |
72 | [NL80211_ATTR_WIPHY_COVERAGE_CLASS] = { .type = NLA_U8 }, | ||
72 | 73 | ||
73 | [NL80211_ATTR_IFTYPE] = { .type = NLA_U32 }, | 74 | [NL80211_ATTR_IFTYPE] = { .type = NLA_U32 }, |
74 | [NL80211_ATTR_IFINDEX] = { .type = NLA_U32 }, | 75 | [NL80211_ATTR_IFINDEX] = { .type = NLA_U32 }, |
@@ -444,6 +445,8 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags, | |||
444 | dev->wiphy.frag_threshold); | 445 | dev->wiphy.frag_threshold); |
445 | NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_RTS_THRESHOLD, | 446 | NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_RTS_THRESHOLD, |
446 | dev->wiphy.rts_threshold); | 447 | dev->wiphy.rts_threshold); |
448 | NLA_PUT_U8(msg, NL80211_ATTR_WIPHY_COVERAGE_CLASS, | ||
449 | dev->wiphy.coverage_class); | ||
447 | 450 | ||
448 | NLA_PUT_U8(msg, NL80211_ATTR_MAX_NUM_SCAN_SSIDS, | 451 | NLA_PUT_U8(msg, NL80211_ATTR_MAX_NUM_SCAN_SSIDS, |
449 | dev->wiphy.max_scan_ssids); | 452 | dev->wiphy.max_scan_ssids); |
@@ -684,6 +687,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info) | |||
684 | u32 changed; | 687 | u32 changed; |
685 | u8 retry_short = 0, retry_long = 0; | 688 | u8 retry_short = 0, retry_long = 0; |
686 | u32 frag_threshold = 0, rts_threshold = 0; | 689 | u32 frag_threshold = 0, rts_threshold = 0; |
690 | u8 coverage_class = 0; | ||
687 | 691 | ||
688 | rtnl_lock(); | 692 | rtnl_lock(); |
689 | 693 | ||
@@ -806,9 +810,16 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info) | |||
806 | changed |= WIPHY_PARAM_RTS_THRESHOLD; | 810 | changed |= WIPHY_PARAM_RTS_THRESHOLD; |
807 | } | 811 | } |
808 | 812 | ||
813 | if (info->attrs[NL80211_ATTR_WIPHY_COVERAGE_CLASS]) { | ||
814 | coverage_class = nla_get_u8( | ||
815 | info->attrs[NL80211_ATTR_WIPHY_COVERAGE_CLASS]); | ||
816 | changed |= WIPHY_PARAM_COVERAGE_CLASS; | ||
817 | } | ||
818 | |||
809 | if (changed) { | 819 | if (changed) { |
810 | u8 old_retry_short, old_retry_long; | 820 | u8 old_retry_short, old_retry_long; |
811 | u32 old_frag_threshold, old_rts_threshold; | 821 | u32 old_frag_threshold, old_rts_threshold; |
822 | u8 old_coverage_class; | ||
812 | 823 | ||
813 | if (!rdev->ops->set_wiphy_params) { | 824 | if (!rdev->ops->set_wiphy_params) { |
814 | result = -EOPNOTSUPP; | 825 | result = -EOPNOTSUPP; |
@@ -819,6 +830,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info) | |||
819 | old_retry_long = rdev->wiphy.retry_long; | 830 | old_retry_long = rdev->wiphy.retry_long; |
820 | old_frag_threshold = rdev->wiphy.frag_threshold; | 831 | old_frag_threshold = rdev->wiphy.frag_threshold; |
821 | old_rts_threshold = rdev->wiphy.rts_threshold; | 832 | old_rts_threshold = rdev->wiphy.rts_threshold; |
833 | old_coverage_class = rdev->wiphy.coverage_class; | ||
822 | 834 | ||
823 | if (changed & WIPHY_PARAM_RETRY_SHORT) | 835 | if (changed & WIPHY_PARAM_RETRY_SHORT) |
824 | rdev->wiphy.retry_short = retry_short; | 836 | rdev->wiphy.retry_short = retry_short; |
@@ -828,6 +840,8 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info) | |||
828 | rdev->wiphy.frag_threshold = frag_threshold; | 840 | rdev->wiphy.frag_threshold = frag_threshold; |
829 | if (changed & WIPHY_PARAM_RTS_THRESHOLD) | 841 | if (changed & WIPHY_PARAM_RTS_THRESHOLD) |
830 | rdev->wiphy.rts_threshold = rts_threshold; | 842 | rdev->wiphy.rts_threshold = rts_threshold; |
843 | if (changed & WIPHY_PARAM_COVERAGE_CLASS) | ||
844 | rdev->wiphy.coverage_class = coverage_class; | ||
831 | 845 | ||
832 | result = rdev->ops->set_wiphy_params(&rdev->wiphy, changed); | 846 | result = rdev->ops->set_wiphy_params(&rdev->wiphy, changed); |
833 | if (result) { | 847 | if (result) { |
@@ -835,6 +849,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info) | |||
835 | rdev->wiphy.retry_long = old_retry_long; | 849 | rdev->wiphy.retry_long = old_retry_long; |
836 | rdev->wiphy.frag_threshold = old_frag_threshold; | 850 | rdev->wiphy.frag_threshold = old_frag_threshold; |
837 | rdev->wiphy.rts_threshold = old_rts_threshold; | 851 | rdev->wiphy.rts_threshold = old_rts_threshold; |
852 | rdev->wiphy.coverage_class = old_coverage_class; | ||
838 | } | 853 | } |
839 | } | 854 | } |
840 | 855 | ||