-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 122476 b: refs/heads/master c: fee5267 h: refs/heads/master v: v3
- Loading branch information
Johannes Berg
authored and
John W. Linville
committed
Dec 5, 2008
1 parent
fb41829
commit a5f6887
Showing
5 changed files
with
70 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: f650470a8f506bc33a15778432ebb8cdcf89175b | ||
refs/heads/master: fee52678dbda2099a25243e79da98dc390e1939a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* cfg80211 - wext compat code | ||
* | ||
* This is temporary code until all wireless functionality is migrated | ||
* into cfg80211, when that happens all the exports here go away and | ||
* we directly assign the wireless handlers of wireless interfaces. | ||
* | ||
* Copyright 2008 Johannes Berg <johannes@sipsolutions.net> | ||
*/ | ||
|
||
#include <linux/wireless.h> | ||
#include <linux/nl80211.h> | ||
#include <net/iw_handler.h> | ||
#include <net/wireless.h> | ||
#include <net/cfg80211.h> | ||
#include "core.h" | ||
|
||
int cfg80211_wext_giwname(struct net_device *dev, | ||
struct iw_request_info *info, | ||
char *name, char *extra) | ||
{ | ||
struct wireless_dev *wdev = dev->ieee80211_ptr; | ||
struct ieee80211_supported_band *sband; | ||
bool is_ht = false, is_a = false, is_b = false, is_g = false; | ||
|
||
if (!wdev) | ||
return -EOPNOTSUPP; | ||
|
||
sband = wdev->wiphy->bands[IEEE80211_BAND_5GHZ]; | ||
if (sband) { | ||
is_a = true; | ||
is_ht |= sband->ht_cap.ht_supported; | ||
} | ||
|
||
sband = wdev->wiphy->bands[IEEE80211_BAND_2GHZ]; | ||
if (sband) { | ||
int i; | ||
/* Check for mandatory rates */ | ||
for (i = 0; i < sband->n_bitrates; i++) { | ||
if (sband->bitrates[i].bitrate == 10) | ||
is_b = true; | ||
if (sband->bitrates[i].bitrate == 60) | ||
is_g = true; | ||
} | ||
is_ht |= sband->ht_cap.ht_supported; | ||
} | ||
|
||
strcpy(name, "IEEE 802.11"); | ||
if (is_a) | ||
strcat(name, "a"); | ||
if (is_b) | ||
strcat(name, "b"); | ||
if (is_g) | ||
strcat(name, "g"); | ||
if (is_ht) | ||
strcat(name, "n"); | ||
|
||
return 0; | ||
} | ||
EXPORT_SYMBOL(cfg80211_wext_giwname); |