aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/wext.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/wext.c')
-rw-r--r--net/mac80211/wext.c50
1 files changed, 49 insertions, 1 deletions
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c
index 5af3862e7191..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}
@@ -567,7 +599,7 @@ static int ieee80211_ioctl_giwscan(struct net_device *dev,
567 if (local->sta_sw_scanning || local->sta_hw_scanning) 599 if (local->sta_sw_scanning || local->sta_hw_scanning)
568 return -EAGAIN; 600 return -EAGAIN;
569 601
570 res = ieee80211_sta_scan_results(dev, extra, data->length); 602 res = ieee80211_sta_scan_results(dev, info, extra, data->length);
571 if (res >= 0) { 603 if (res >= 0) {
572 data->length = res; 604 data->length = res;
573 return 0; 605 return 0;
@@ -721,6 +753,9 @@ static int ieee80211_ioctl_siwrts(struct net_device *dev,
721 753
722 if (rts->disabled) 754 if (rts->disabled)
723 local->rts_threshold = IEEE80211_MAX_RTS_THRESHOLD; 755 local->rts_threshold = IEEE80211_MAX_RTS_THRESHOLD;
756 else if (!rts->fixed)
757 /* if the rts value is not fixed, then take default */
758 local->rts_threshold = IEEE80211_MAX_RTS_THRESHOLD;
724 else if (rts->value < 0 || rts->value > IEEE80211_MAX_RTS_THRESHOLD) 759 else if (rts->value < 0 || rts->value > IEEE80211_MAX_RTS_THRESHOLD)
725 return -EINVAL; 760 return -EINVAL;
726 else 761 else
@@ -949,6 +984,19 @@ static int ieee80211_ioctl_giwencode(struct net_device *dev,
949 erq->length = sdata->keys[idx]->conf.keylen; 984 erq->length = sdata->keys[idx]->conf.keylen;
950 erq->flags |= IW_ENCODE_ENABLED; 985 erq->flags |= IW_ENCODE_ENABLED;
951 986
987 if (sdata->vif.type == IEEE80211_IF_TYPE_STA) {
988 struct ieee80211_if_sta *ifsta = &sdata->u.sta;
989 switch (ifsta->auth_alg) {
990 case WLAN_AUTH_OPEN:
991 case WLAN_AUTH_LEAP:
992 erq->flags |= IW_ENCODE_OPEN;
993 break;
994 case WLAN_AUTH_SHARED_KEY:
995 erq->flags |= IW_ENCODE_RESTRICTED;
996 break;
997 }
998 }
999
952 return 0; 1000 return 0;
953} 1001}
954 1002