diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2008-06-24 08:50:17 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-06-27 09:09:20 -0400 |
commit | f37d08bddc5cb8de18e55f2b0a401b3eb6269af4 (patch) | |
tree | ddb9b80a0b8a89766b0b7c21f4c917855e6981de /net/mac80211/wext.c | |
parent | b9fcc4f2987a757acb3af43aa31dc860bb957970 (diff) |
mac80211: add phy information to giwname
This patch add phy information to giwname.
Quoting:
It's not useless, it's supposed to tell you about the protocol
capability of the device, like "IEEE 802.11b" or "IEEE 802.11abg"
Jean
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/wext.c')
-rw-r--r-- | net/mac80211/wext.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c index 5e76ab120cd6..df0531c28141 100644 --- a/net/mac80211/wext.c +++ b/net/mac80211/wext.c | |||
@@ -135,7 +135,39 @@ static int ieee80211_ioctl_giwname(struct net_device *dev, | |||
135 | struct iw_request_info *info, | 135 | struct iw_request_info *info, |
136 | char *name, char *extra) | 136 | char *name, char *extra) |
137 | { | 137 | { |
138 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | ||
139 | struct ieee80211_supported_band *sband; | ||
140 | u8 is_ht = 0, is_a = 0, is_b = 0, is_g = 0; | ||
141 | |||
142 | |||
143 | sband = local->hw.wiphy->bands[IEEE80211_BAND_5GHZ]; | ||
144 | if (sband) { | ||
145 | is_a = 1; | ||
146 | is_ht |= sband->ht_info.ht_supported; | ||
147 | } | ||
148 | |||
149 | sband = local->hw.wiphy->bands[IEEE80211_BAND_2GHZ]; | ||
150 | if (sband) { | ||
151 | int i; | ||
152 | /* Check for mandatory rates */ | ||
153 | for (i = 0; i < sband->n_bitrates; i++) { | ||
154 | if (sband->bitrates[i].bitrate == 10) | ||
155 | is_b = 1; | ||
156 | if (sband->bitrates[i].bitrate == 60) | ||
157 | is_g = 1; | ||
158 | } | ||
159 | is_ht |= sband->ht_info.ht_supported; | ||
160 | } | ||
161 | |||
138 | strcpy(name, "IEEE 802.11"); | 162 | strcpy(name, "IEEE 802.11"); |
163 | if (is_a) | ||
164 | strcat(name, "a"); | ||
165 | if (is_b) | ||
166 | strcat(name, "b"); | ||
167 | if (is_g) | ||
168 | strcat(name, "g"); | ||
169 | if (is_ht) | ||
170 | strcat(name, "n"); | ||
139 | 171 | ||
140 | return 0; | 172 | return 0; |
141 | } | 173 | } |