]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/wireless/util.c
reiserfs: rename p_s_tb to tb
[linux-2.6-omap-h63xx.git] / net / wireless / util.c
index f54424693a38a378bd5e7cdc25326907b5fbb983..e76cc28b034557fc1dfcadbae21a09307f6fee5c 100644 (file)
@@ -7,6 +7,25 @@
 #include <asm/bitops.h>
 #include "core.h"
 
+struct ieee80211_rate *
+ieee80211_get_response_rate(struct ieee80211_supported_band *sband,
+                           u64 basic_rates, int bitrate)
+{
+       struct ieee80211_rate *result = &sband->bitrates[0];
+       int i;
+
+       for (i = 0; i < sband->n_bitrates; i++) {
+               if (!(basic_rates & BIT(i)))
+                       continue;
+               if (sband->bitrates[i].bitrate > bitrate)
+                       continue;
+               result = &sband->bitrates[i];
+       }
+
+       return result;
+}
+EXPORT_SYMBOL(ieee80211_get_response_rate);
+
 int ieee80211_channel_to_frequency(int chan)
 {
        if (chan < 14)