aboutsummaryrefslogtreecommitdiffstats
path: root/net/ieee80211/ieee80211_geo.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-03-01 01:59:15 -0500
committerJeff Garzik <jeff@garzik.org>2006-03-01 01:59:15 -0500
commit75e47b36004d136edff68295420424cba3a5ccd0 (patch)
tree363c2bc1f8b5185b37f05106fec4ba2a07134182 /net/ieee80211/ieee80211_geo.c
parent68727fed5469100bec0764207d7efb7a9ecdee29 (diff)
parent07981aa43f6aec32b875f360755ed3d14f9d5139 (diff)
Merge branch 'upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
Diffstat (limited to 'net/ieee80211/ieee80211_geo.c')
-rw-r--r--net/ieee80211/ieee80211_geo.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/net/ieee80211/ieee80211_geo.c b/net/ieee80211/ieee80211_geo.c
index 3027153940fc..192243ab35ed 100644
--- a/net/ieee80211/ieee80211_geo.c
+++ b/net/ieee80211/ieee80211_geo.c
@@ -50,7 +50,8 @@ int ieee80211_is_valid_channel(struct ieee80211_device *ieee, u8 channel)
50 50
51 /* Driver needs to initialize the geography map before using 51 /* Driver needs to initialize the geography map before using
52 * these helper functions */ 52 * these helper functions */
53 BUG_ON(ieee->geo.bg_channels == 0 && ieee->geo.a_channels == 0); 53 if (ieee->geo.bg_channels == 0 && ieee->geo.a_channels == 0)
54 return 0;
54 55
55 if (ieee->freq_band & IEEE80211_24GHZ_BAND) 56 if (ieee->freq_band & IEEE80211_24GHZ_BAND)
56 for (i = 0; i < ieee->geo.bg_channels; i++) 57 for (i = 0; i < ieee->geo.bg_channels; i++)
@@ -78,7 +79,8 @@ int ieee80211_channel_to_index(struct ieee80211_device *ieee, u8 channel)
78 79
79 /* Driver needs to initialize the geography map before using 80 /* Driver needs to initialize the geography map before using
80 * these helper functions */ 81 * these helper functions */
81 BUG_ON(ieee->geo.bg_channels == 0 && ieee->geo.a_channels == 0); 82 if (ieee->geo.bg_channels == 0 && ieee->geo.a_channels == 0)
83 return -1;
82 84
83 if (ieee->freq_band & IEEE80211_24GHZ_BAND) 85 if (ieee->freq_band & IEEE80211_24GHZ_BAND)
84 for (i = 0; i < ieee->geo.bg_channels; i++) 86 for (i = 0; i < ieee->geo.bg_channels; i++)
@@ -99,7 +101,8 @@ u8 ieee80211_freq_to_channel(struct ieee80211_device * ieee, u32 freq)
99 101
100 /* Driver needs to initialize the geography map before using 102 /* Driver needs to initialize the geography map before using
101 * these helper functions */ 103 * these helper functions */
102 BUG_ON(ieee->geo.bg_channels == 0 && ieee->geo.a_channels == 0); 104 if (ieee->geo.bg_channels == 0 && ieee->geo.a_channels == 0)
105 return 0;
103 106
104 freq /= 100000; 107 freq /= 100000;
105 108