]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - net/wireless/util.c
wireless: convert wireless ioctl to net_device_ops
[mv-sheeva.git] / net / wireless / util.c
index f3e623df3515d8f4ac1bc328b9831d441e09ada7..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)
@@ -33,8 +52,8 @@ int ieee80211_frequency_to_channel(int freq)
 }
 EXPORT_SYMBOL(ieee80211_frequency_to_channel);
 
-struct ieee80211_channel *ieee80211_get_channel(struct wiphy *wiphy,
-                                               int freq)
+struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy,
+                                                 int freq)
 {
        enum ieee80211_band band;
        struct ieee80211_supported_band *sband;
@@ -54,7 +73,7 @@ struct ieee80211_channel *ieee80211_get_channel(struct wiphy *wiphy,
 
        return NULL;
 }
-EXPORT_SYMBOL(ieee80211_get_channel);
+EXPORT_SYMBOL(__ieee80211_get_channel);
 
 static void set_mandatory_flags_band(struct ieee80211_supported_band *sband,
                                     enum ieee80211_band band)