aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/wireless/util.c')
-rw-r--r--net/wireless/util.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/net/wireless/util.c b/net/wireless/util.c
index f54424693a38..e76cc28b0345 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -7,6 +7,25 @@
7#include <asm/bitops.h> 7#include <asm/bitops.h>
8#include "core.h" 8#include "core.h"
9 9
10struct ieee80211_rate *
11ieee80211_get_response_rate(struct ieee80211_supported_band *sband,
12 u64 basic_rates, int bitrate)
13{
14 struct ieee80211_rate *result = &sband->bitrates[0];
15 int i;
16
17 for (i = 0; i < sband->n_bitrates; i++) {
18 if (!(basic_rates & BIT(i)))
19 continue;
20 if (sband->bitrates[i].bitrate > bitrate)
21 continue;
22 result = &sband->bitrates[i];
23 }
24
25 return result;
26}
27EXPORT_SYMBOL(ieee80211_get_response_rate);
28
10int ieee80211_channel_to_frequency(int chan) 29int ieee80211_channel_to_frequency(int chan)
11{ 30{
12 if (chan < 14) 31 if (chan < 14)