aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/core.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-01-24 13:38:38 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-02-29 15:19:32 -0500
commit8318d78a44d49ac1edf2bdec7299de3617c4232e (patch)
treed434634418edd7399737801615d247be06616fdd /net/wireless/core.c
parent10b6b80145cc93887dd8aab99bfffa375e9add31 (diff)
cfg80211 API for channels/bitrates, mac80211 and driver conversion
This patch creates new cfg80211 wiphy API for channel and bitrate registration and converts mac80211 and drivers to the new API. The old mac80211 API is completely ripped out. All drivers (except ath5k) are updated to the new API, in many cases I expect that optimisations can be done. Along with the regulatory code I've also ripped out the IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED flag, I believe it to be unnecessary if the hardware simply gives us whatever channels it wants to support and we then enable/disable them as required, which is pretty much required for travelling. Additionally, the patch adds proper "basic" rate handling for STA mode interface, AP mode interface will have to have new API added to allow userspace to set the basic rate set, currently it'll be empty... However, the basic rate handling will need to be moved to the BSS conf stuff. I do expect there to be bugs in this, especially wrt. transmit power handling where I'm basically clueless about how it should work. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/core.c')
-rw-r--r--net/wireless/core.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c
index cfc5fc5f9e75..80afacdae46c 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -232,6 +232,47 @@ int wiphy_register(struct wiphy *wiphy)
232{ 232{
233 struct cfg80211_registered_device *drv = wiphy_to_dev(wiphy); 233 struct cfg80211_registered_device *drv = wiphy_to_dev(wiphy);
234 int res; 234 int res;
235 enum ieee80211_band band;
236 struct ieee80211_supported_band *sband;
237 bool have_band = false;
238 int i;
239
240 /* sanity check supported bands/channels */
241 for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
242 sband = wiphy->bands[band];
243 if (!sband)
244 continue;
245
246 sband->band = band;
247
248 if (!sband->n_channels || !sband->n_bitrates) {
249 WARN_ON(1);
250 return -EINVAL;
251 }
252
253 for (i = 0; i < sband->n_channels; i++) {
254 sband->channels[i].orig_flags =
255 sband->channels[i].flags;
256 sband->channels[i].orig_mag =
257 sband->channels[i].max_antenna_gain;
258 sband->channels[i].orig_mpwr =
259 sband->channels[i].max_power;
260 sband->channels[i].band = band;
261 }
262
263 have_band = true;
264 }
265
266 if (!have_band) {
267 WARN_ON(1);
268 return -EINVAL;
269 }
270
271 /* check and set up bitrates */
272 ieee80211_set_bitrate_flags(wiphy);
273
274 /* set up regulatory info */
275 wiphy_update_regulatory(wiphy);
235 276
236 mutex_lock(&cfg80211_drv_mutex); 277 mutex_lock(&cfg80211_drv_mutex);
237 278