diff options
author | Hauke Mehrtens <hauke@openwrt.org> | 2010-07-18 19:39:57 +0000 |
---|---|---|
committer | Hauke Mehrtens <hauke@openwrt.org> | 2010-07-18 19:39:57 +0000 |
commit | a210f2006c761a6f83633ed90f9884bbd1c4a260 (patch) | |
tree | b5d5bde84d380994c84bdc4c9b222d142666fdd9 /package/iw/patches/100-coverage_class.patch | |
parent | d8da685340083211c0e7ea37d6750c3e8383552b (diff) | |
download | upstream-a210f2006c761a6f83633ed90f9884bbd1c4a260.tar.gz upstream-a210f2006c761a6f83633ed90f9884bbd1c4a260.tar.bz2 upstream-a210f2006c761a6f83633ed90f9884bbd1c4a260.zip |
iw: update to version 0.9.20
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22285 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/iw/patches/100-coverage_class.patch')
-rw-r--r-- | package/iw/patches/100-coverage_class.patch | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/package/iw/patches/100-coverage_class.patch b/package/iw/patches/100-coverage_class.patch deleted file mode 100644 index 8e18e038d6..0000000000 --- a/package/iw/patches/100-coverage_class.patch +++ /dev/null @@ -1,81 +0,0 @@ ---- a/info.c -+++ b/info.c -@@ -156,6 +156,14 @@ static int print_phy_handler(struct nl_m - printf("\tRTS threshold: %d\n", rts); - } - -+ if (tb_msg[NL80211_ATTR_WIPHY_COVERAGE_CLASS]) { -+ unsigned char coverage; -+ -+ coverage = nla_get_u8(tb_msg[NL80211_ATTR_WIPHY_COVERAGE_CLASS]); -+ /* See handle_distance() for an explanation where the '450' comes from */ -+ printf("\tCoverage class: %d (up to %dm)\n", coverage, 450 * coverage); -+ } -+ - if (!tb_msg[NL80211_ATTR_SUPPORTED_IFTYPES]) - goto commands; - ---- a/phy.c -+++ b/phy.c -@@ -164,3 +164,61 @@ static int handle_netns(struct nl80211_s - COMMAND(set, netns, "<pid>", - NL80211_CMD_SET_WIPHY_NETNS, 0, CIB_PHY, handle_netns, - "Put this wireless device into a different network namespace"); -+ -+static int handle_coverage(struct nl80211_state *state, -+ struct nl_cb *cb, -+ struct nl_msg *msg, -+ int argc, char **argv) -+{ -+ unsigned int coverage; -+ -+ if (argc != 1) -+ return 1; -+ -+ coverage = strtoul(argv[0], NULL, 10); -+ if (coverage > 255) -+ return 1; -+ -+ NLA_PUT_U8(msg, NL80211_ATTR_WIPHY_COVERAGE_CLASS, coverage); -+ -+ return 0; -+ nla_put_failure: -+ return -ENOBUFS; -+} -+COMMAND(set, coverage, "<coverage class>", -+ NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_coverage, -+ "Set coverage class (1 for every 3 usec of air propagation time).\n" -+ "Valid values: 0 - 255."); -+ -+static int handle_distance(struct nl80211_state *state, -+ struct nl_cb *cb, -+ struct nl_msg *msg, -+ int argc, char **argv) -+{ -+ unsigned int distance, coverage; -+ -+ if (argc != 1) -+ return 1; -+ -+ distance = strtoul(argv[0], NULL, 10); -+ -+ /* -+ * Divide double the distance by the speed of light in m/usec (300) to -+ * get round-trip time in microseconds and then divide the result by -+ * three to get coverage class as specified in IEEE 802.11-2007 table -+ * 7-27. Values are rounded upwards. -+ */ -+ coverage = (distance + 449) / 450; -+ if (coverage > 255) -+ return 1; -+ -+ NLA_PUT_U8(msg, NL80211_ATTR_WIPHY_COVERAGE_CLASS, coverage); -+ -+ return 0; -+ nla_put_failure: -+ return -ENOBUFS; -+} -+COMMAND(set, distance, "<distance>", -+ NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_distance, -+ "Set appropriate coverage class for given link distance in meters.\n" -+ "Valid values: 0 - 114750"); |