cfg80211: set WE encoding size based on available ciphers
authorDavid Kilroy <kilroyd@googlemail.com>
Thu, 18 Jun 2009 22:21:16 +0000 (23:21 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 10 Jul 2009 19:01:42 +0000 (15:01 -0400)
Only set the sizes for WEP40 and WEP104.

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/wireless/wext-compat.c

index bb97061219ca43d2d2ee3a3bd182b5842f0e92e2..2f7e7760bc7e8adcf742ff932ec34bdb11181e40 100644 (file)
@@ -173,9 +173,6 @@ int cfg80211_wext_giwrange(struct net_device *dev,
        range->min_frag = 256;
        range->max_frag = 2346;
 
-       range->encoding_size[0] = 5;
-       range->encoding_size[1] = 13;
-       range->num_encoding_sizes = 2;
        range->max_encoding_tokens = 4;
 
        range->max_qual.updated = IW_QUAL_NOISE_INVALID;
@@ -215,6 +212,16 @@ int cfg80211_wext_giwrange(struct net_device *dev,
                case WLAN_CIPHER_SUITE_CCMP:
                        range->enc_capa |= IW_ENC_CAPA_CIPHER_CCMP;
                        break;
+
+               case WLAN_CIPHER_SUITE_WEP40:
+                       range->encoding_size[range->num_encoding_sizes++] =
+                               WLAN_KEY_LEN_WEP40;
+                       break;
+
+               case WLAN_CIPHER_SUITE_WEP104:
+                       range->encoding_size[range->num_encoding_sizes++] =
+                               WLAN_KEY_LEN_WEP104;
+                       break;
                }
        }