diff options
author | Lukáš Turek <8an@praha12.net> | 2009-12-21 16:50:47 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-01-12 13:49:17 -0500 |
commit | 81077e82c3f591578625805dd6464a27a9ff56ec (patch) | |
tree | cb1e502c54b4e2f052f129b80a47190de7e22b62 /net/wireless | |
parent | 14acdde6e527950f66c084dbf19bad6fbfcaeedc (diff) |
nl80211: Add new WIPHY attribute COVERAGE_CLASS
The new attribute NL80211_ATTR_WIPHY_COVERAGE_CLASS sets IEEE 802.11
Coverage Class, which depends on maximum distance of nodes in a
wireless network. It's required for long distance links (more than a few
hundred meters).
The attribute is now ignored by two non-mac80211 drivers, rndis and
iwmc3200wifi, together with WIPHY_PARAM_RETRY_SHORT and
WIPHY_PARAM_RETRY_LONG. If it turns out to be a problem, we could split
set_wiphy_params callback or add new capability bits.
Signed-off-by: Lukas Turek <8an@praha12.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/core.c | 1 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c index c2a2c563d21a..0a545bb6ed05 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c | |||
@@ -402,6 +402,7 @@ struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv) | |||
402 | rdev->wiphy.retry_long = 4; | 402 | rdev->wiphy.retry_long = 4; |
403 | rdev->wiphy.frag_threshold = (u32) -1; | 403 | rdev->wiphy.frag_threshold = (u32) -1; |
404 | rdev->wiphy.rts_threshold = (u32) -1; | 404 | rdev->wiphy.rts_threshold = (u32) -1; |
405 | rdev->wiphy.coverage_class = 0; | ||
405 | 406 | ||
406 | return &rdev->wiphy; | 407 | return &rdev->wiphy; |
407 | } | 408 | } |
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 | ||